Skip to content

Commit

Permalink
bgpd: add memberCount into peer-grp json output
Browse files Browse the repository at this point in the history
Member count is not part of current show bgp peer-group json output.

Fix:

memberCount attribute is added into bgp peer-grp json output.

Supported commands:

Default VRF :

- show bgp peer-group json

Non-Default VRF:

- show bgp vrf tenant1 peer-group json

UT done

Ticket:#4073454

Issue: 4073454

Signed-off-by: Sindhu Parvathi Gopinathan's <[email protected]>
  • Loading branch information
Sindhu Parvathi Gopinathan authored and donaldsharp committed Dec 18, 2024
1 parent 0d67141 commit cc92edb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bgpd/bgp_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -16778,6 +16778,7 @@ static int bgp_show_one_peer_group(struct vty *vty, struct peer_group *group,
json_object *json_peer_group_dynamic = NULL;
json_object *json_peer_group_dynamic_af = NULL;
json_object *json_peer_group_ranges = NULL;
uint16_t member_count = 0;

conf = group->conf;

Expand Down Expand Up @@ -16945,10 +16946,14 @@ static int bgp_show_one_peer_group(struct vty *vty, struct peer_group *group,
dynamic ? "(dynamic)" : "",
peer_status);
}
member_count++;
}
if (json)
if (json) {
json_object_int_add(json_peer_group_members,
"memberCount", member_count);
json_object_object_add(json_peer_group, "members",
json_peer_group_members);
}
}

if (json)
Expand Down

0 comments on commit cc92edb

Please sign in to comment.