]> git.proxmox.com Git - mirror_frr.git/commitdiff
*: Add camelCase JSON keys in addition to PascalCase
authorDonatas Abraitis <donatas.abraitis@gmail.com>
Mon, 31 Jan 2022 19:42:17 +0000 (21:42 +0200)
committerDonatas Abraitis <donatas.abraitis@gmail.com>
Thu, 3 Feb 2022 08:48:06 +0000 (10:48 +0200)
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
bgpd/bgp_labelpool.c
bgpd/bgp_route.c
ldpd/ldp_vty_exec.c
ospf6d/ospf6_gr_helper.c
ospf6d/ospf6_lsa.c
ospfd/ospf_ldp_sync.c
ospfd/ospf_vty.c
pimd/pim_cmd.c

index 1bc7b6230437ab0d9ebdfe6ee25092d42d161edc..8772afd73642329140fe93189ee6db47c588841f 100644 (file)
@@ -631,13 +631,23 @@ DEFUN(show_bgp_labelpool_summary, show_bgp_labelpool_summary_cmd,
 
        if (uj) {
                json = json_object_new_object();
+#if CONFDATE > 20230131
+CPP_NOTICE("Remove JSON object commands with keys starting with capital")
+#endif
                json_object_int_add(json, "Ledger", skiplist_count(lp->ledger));
+               json_object_int_add(json, "ledger", skiplist_count(lp->ledger));
                json_object_int_add(json, "InUse", skiplist_count(lp->inuse));
+               json_object_int_add(json, "inUse", skiplist_count(lp->inuse));
                json_object_int_add(json, "Requests",
                                    lp_fifo_count(&lp->requests));
+               json_object_int_add(json, "requests",
+                                   lp_fifo_count(&lp->requests));
                json_object_int_add(json, "LabelChunks", listcount(lp->chunks));
+               json_object_int_add(json, "labelChunks", listcount(lp->chunks));
                json_object_int_add(json, "Pending", lp->pending_count);
+               json_object_int_add(json, "pending", lp->pending_count);
                json_object_int_add(json, "Reconnects", lp->reconnect_count);
+               json_object_int_add(json, "reconnects", lp->reconnect_count);
                vty_json(vty, json);
        } else {
                vty_out(vty, "Labelpool Summary\n");
index fa83a457bf8e38d5f0ba916f9c3ee93f30d1036e..331f98fe95beaeea63d18374662bde9c77e60cfc 100644 (file)
@@ -9506,6 +9506,8 @@ void route_vty_out_overlay(struct vty *vty, const struct prefix *p,
                } else {
                        json_object_string_add(json_nexthop, "Error",
                                               "Unsupported address-family");
+                       json_object_string_add(json_nexthop, "error",
+                                              "Unsupported address-family");
                }
        }
 
@@ -9875,9 +9877,12 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct bgp_dest *bn,
                                if (tag_buf[0] != '\0')
                                        vty_out(vty, " VNI %s", tag_buf);
                        } else {
-                               if (tag_buf[0])
+                               if (tag_buf[0]) {
                                        json_object_string_add(json_path, "VNI",
                                                               tag_buf);
+                                       json_object_string_add(json_path, "vni",
+                                                              tag_buf);
+                               }
                        }
                }
 
index 7bad1dca7c13a9dee0f5e09271595728d05aa403..c4053f5374cc3d85da8e0d170ac839bfa36e2dbf 100644 (file)
@@ -1472,7 +1472,11 @@ show_l2vpn_pw_msg_json(struct imsg *imsg, struct show_params *params,
                json_pw = json_object_new_object();
                json_object_string_addf(json_pw, "peerId", "%pI4", &pw->lsr_id);
                json_object_int_add(json_pw, "vcId", pw->pwid);
+#if CONFDATE > 20230131
+CPP_NOTICE("Remove JSON object commands with keys starting with capital")
+#endif
                json_object_string_add(json_pw, "VpnName", pw->l2vpn_name);
+               json_object_string_add(json_pw, "vpnName", pw->l2vpn_name);
                if (pw->status == PW_FORWARDING)
                        json_object_string_add(json_pw, "status", "up");
                else
index 84ee35a3ed942abee6d3c7b5916a46a89923151d..dff6849e901f101356db25da546097feefcf5689 100644 (file)
@@ -961,13 +961,22 @@ static void show_ospf6_gr_helper_details(struct vty *vty, struct ospf6 *ospf6,
                        json, "supportedGracePeriod",
                        ospf6->ospf6_helper_cfg.supported_grace_time);
 
-               if (ospf6->ospf6_helper_cfg.last_exit_reason
-                   != OSPF6_GR_HELPER_EXIT_NONE)
+#if CONFDATE > 20230131
+CPP_NOTICE("Remove JSON object commands with keys starting with capital")
+#endif
+               if (ospf6->ospf6_helper_cfg.last_exit_reason !=
+                   OSPF6_GR_HELPER_EXIT_NONE) {
                        json_object_string_add(
                                json, "LastExitReason",
                                ospf6_exit_reason_desc
                                        [ospf6->ospf6_helper_cfg
                                                 .last_exit_reason]);
+                       json_object_string_add(
+                               json, "lastExitReason",
+                               ospf6_exit_reason_desc
+                                       [ospf6->ospf6_helper_cfg
+                                                .last_exit_reason]);
+               }
 
                if (OSPF6_HELPER_ENABLE_RTR_COUNT(ospf6)) {
                        struct json_object *json_rid_array =
@@ -996,12 +1005,18 @@ static void show_ospf6_gr_helper_details(struct vty *vty, struct ospf6 *ospf6,
                                        json_object_object_get_ex(
                                                json, "Neighbors",
                                                &json_neighbors);
+                                       json_object_object_get_ex(
+                                               json, "neighbors",
+                                               &json_neighbors);
                                        if (!json_neighbors) {
                                                json_neighbors =
                                                json_object_new_object();
                                                json_object_object_add(
                                                        json, "Neighbors",
                                                        json_neighbors);
+                                               json_object_object_add(
+                                                       json, "neighbors",
+                                                       json_neighbors);
                                        }
                                }
 
index 99d0de39cfb69ecf5271608a7fd6b8a3beb663f4..b07b87737ed00f6350f299cfe91c96abd37394a1 100644 (file)
@@ -85,9 +85,13 @@ static int ospf6_unknown_lsa_show(struct vty *vty, struct ospf6_lsa *lsa,
        start = (uint8_t *)lsa->header + sizeof(struct ospf6_lsa_header);
        end = (uint8_t *)lsa->header + ntohs(lsa->header->length);
 
-       if (use_json)
+#if CONFDATE > 20230131
+CPP_NOTICE("Remove JSON object commands with keys starting with capital")
+#endif
+       if (use_json) {
                json_object_string_add(json_obj, "LsaType", "unknown");
-       else {
+               json_object_string_add(json_obj, "lsaType", "unknown");
+       } else {
                vty_out(vty, "        Unknown contents:\n");
                for (current = start; current < end; current++) {
                        if ((current - start) % 16 == 0)
index 247ceb0a08d6831a29ea1f82edef480a692d69ee..df691bf4da75cc698c08e7ac4bc93aed1ea9165d 100644 (file)
@@ -509,10 +509,17 @@ void ospf_ldp_sync_show_info(struct vty *vty, struct ospf *ospf,
 
        if (CHECK_FLAG(ospf->ldp_sync_cmd.flags, LDP_SYNC_FLAG_ENABLE)) {
                if (use_json) {
+#if CONFDATE > 20230131
+CPP_NOTICE("Remove JSON object commands with keys starting with capital")
+#endif
                        json_object_boolean_true_add(json_vrf,
                                                     "MplsLdpIgpSyncEnabled");
+                       json_object_boolean_true_add(json_vrf,
+                                                    "mplsLdpIgpSyncEnabled");
                        json_object_int_add(json_vrf, "MplsLdpIgpSyncHolddown",
                                            ospf->ldp_sync_cmd.holddown);
+                       json_object_int_add(json_vrf, "mplsLdpIgpSyncHolddown",
+                                           ospf->ldp_sync_cmd.holddown);
                } else {
                        vty_out(vty, " MPLS LDP-IGP Sync is enabled\n");
                        if (ospf->ldp_sync_cmd.holddown == 0)
index ac87c0805f67096fccb46b0239a6bbbcc7340578..97b581dae92f4f01b2f70e37523df866b19fe7e4 100644 (file)
@@ -10205,10 +10205,17 @@ static int ospf_show_gr_helper_details(struct vty *vty, struct ospf *ospf,
                json_object_int_add(json_vrf, "supportedGracePeriod",
                                    ospf->supported_grace_time);
 
-               if (ospf->last_exit_reason != OSPF_GR_HELPER_EXIT_NONE)
+#if CONFDATE > 20230131
+CPP_NOTICE("Remove JSON object commands with keys starting with capital")
+#endif
+               if (ospf->last_exit_reason != OSPF_GR_HELPER_EXIT_NONE) {
                        json_object_string_add(
                                json_vrf, "LastExitReason",
                                ospf_exit_reason2str(ospf->last_exit_reason));
+                       json_object_string_add(
+                               json_vrf, "lastExitReason",
+                               ospf_exit_reason2str(ospf->last_exit_reason));
+               }
 
                if (ospf->active_restarter_cnt)
                        json_object_int_add(json_vrf, "activeRestarterCnt",
@@ -10231,12 +10238,17 @@ static int ospf_show_gr_helper_details(struct vty *vty, struct ospf *ospf,
                        if (uj) {
                                json_object_object_get_ex(json_vrf, "Neighbors",
                                                          &json_neighbors);
+                               json_object_object_get_ex(json_vrf, "neighbors",
+                                                         &json_neighbors);
                                if (!json_neighbors) {
                                        json_neighbors =
                                                json_object_new_object();
                                        json_object_object_add(json_vrf,
                                                               "Neighbors",
                                                               json_neighbors);
+                                       json_object_object_add(json_vrf,
+                                                              "neighbors",
+                                                              json_neighbors);
                                }
                        }
 
@@ -10735,9 +10747,12 @@ static void show_ip_ospf_route_router(struct vty *vty, struct ospf *ospf,
                                json_object_string_addf(json_route, "area",
                                                        "%pI4",
                                                        &or->u.std.area_id);
-                               if (or->path_type == OSPF_PATH_INTER_AREA)
+                               if (or->path_type == OSPF_PATH_INTER_AREA) {
                                        json_object_boolean_true_add(json_route,
                                                                     "IA");
+                                       json_object_boolean_true_add(json_route,
+                                                                    "ia");
+                               }
                                if (or->u.std.flags & ROUTER_LSA_BORDER)
                                        json_object_string_add(json_route,
                                                               "routerType",
@@ -11490,10 +11505,16 @@ static int ospf_show_summary_address(struct vty *vty, struct ospf *ospf,
                                                ? "E1"
                                                : "E2");
 
+#if CONFDATE > 20230131
+CPP_NOTICE("Remove JSON object commands with keys starting with capital")
+#endif
                                json_object_int_add(json_aggr, "Metric", mval);
+                               json_object_int_add(json_aggr, "metric", mval);
 
                                json_object_int_add(json_aggr, "Tag",
                                                    aggr->tag);
+                               json_object_int_add(json_aggr, "tag",
+                                                   aggr->tag);
 
                                json_object_int_add(
                                        json_aggr, "External route count",
index 01cb35177e7e920dbdab27fc502b9e77c33d6188..2926a8ae7568752dbab46f5613dc19f65c4771b6 100644 (file)
@@ -1692,8 +1692,13 @@ static void pim_show_join_helper(struct vty *vty, struct pim_interface *pim_ifp,
                json_object_string_add(
                        json_row, "channelJoinName",
                        pim_ifchannel_ifjoin_name(ch->ifjoin_state, ch->flags));
-               if (PIM_IF_FLAG_TEST_S_G_RPT(ch->flags))
+               if (PIM_IF_FLAG_TEST_S_G_RPT(ch->flags)) {
+#if CONFDATE > 20230131
+CPP_NOTICE("Remove JSON object commands with keys starting with capital")
+#endif
                        json_object_int_add(json_row, "SGRpt", 1);
+                       json_object_int_add(json_row, "sgRpt", 1);
+               }
                if (PIM_IF_FLAG_TEST_PROTO_PIM(ch->flags))
                        json_object_int_add(json_row, "protocolPim", 1);
                if (PIM_IF_FLAG_TEST_PROTO_IGMP(ch->flags))
@@ -2047,6 +2052,8 @@ static void pim_show_state(struct pim_instance *pim, struct vty *vty,
                                                       json_ifp_in);
                                json_object_int_add(json_source, "Installed",
                                                    c_oil->installed);
+                               json_object_int_add(json_source, "installed",
+                                                   c_oil->installed);
                                if (isRpt)
                                        json_object_boolean_true_add(
                                                json_source, "isRpt");
@@ -2055,20 +2062,36 @@ static void pim_show_state(struct pim_instance *pim, struct vty *vty,
                                                json_source, "isRpt");
                                json_object_int_add(json_source, "RefCount",
                                                    c_oil->oil_ref_count);
+                               json_object_int_add(json_source, "refCount",
+                                                   c_oil->oil_ref_count);
                                json_object_int_add(json_source, "OilListSize",
                                                    c_oil->oil_size);
+                               json_object_int_add(json_source, "oilListSize",
+                                                   c_oil->oil_size);
                                json_object_int_add(
                                        json_source, "OilRescan",
                                        c_oil->oil_inherited_rescan);
+                               json_object_int_add(
+                                       json_source, "oilRescan",
+                                       c_oil->oil_inherited_rescan);
                                json_object_int_add(json_source, "LastUsed",
                                                    c_oil->cc.lastused);
+                               json_object_int_add(json_source, "lastUsed",
+                                                   c_oil->cc.lastused);
                                json_object_int_add(json_source, "PacketCount",
                                                    c_oil->cc.pktcnt);
+                               json_object_int_add(json_source, "packetCount",
+                                                   c_oil->cc.pktcnt);
                                json_object_int_add(json_source, "ByteCount",
                                                    c_oil->cc.bytecnt);
+                               json_object_int_add(json_source, "byteCount",
+                                                   c_oil->cc.bytecnt);
                                json_object_int_add(json_source,
                                                    "WrongInterface",
                                                    c_oil->cc.wrong_if);
+                               json_object_int_add(json_source,
+                                                   "wrongInterface",
+                                                   c_oil->cc.wrong_if);
                        }
                } else {
                        vty_out(vty, "%-6d %-15s  %-15s  %-3s  %-16s  ",
@@ -5923,6 +5946,8 @@ static void show_mroute(struct pim_instance *pim, struct vty *vty,
                                            c_oil->oil_size);
                        json_object_int_add(json_source, "OilInheritedRescan",
                                            c_oil->oil_inherited_rescan);
+                       json_object_int_add(json_source, "oilInheritedRescan",
+                                           c_oil->oil_inherited_rescan);
                        json_object_string_add(json_source, "iif", in_ifname);
                        json_object_string_add(json_source, "upTime",
                                               mroute_uptime);