Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bgpd: add memberCount into peer-grp json output #16950

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chiragshah6
Copy link
Member

@chiragshah6 chiragshah6 commented Sep 27, 2024

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:

  • show bgp peer-group json
  • show bgp vrf tenant1 peer-group json

Testing:

tor-11# show bgp peer-group json
{

    {
      "ISL":{
        "remoteAs":0,
        "type":"external",
        "addressFamiliesConfigured":[
          "IPv4 Unicast"
        ],
        "members":{
          "swp1":{
            "status":"Established"
          },
          "swp2":{
            "status":"Established"
          },
          "memberCount":2
        }
      }
    }

Signed-off-by: Sindhu Parvathi Gopinathan's [email protected]

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:

- show bgp peer-group json
- show bgp vrf tenant1 peer-group json

Ticket:#4073454

Testing:

tor-11# show bgp peer-group json
{
  "ISL":{
    "remoteAs":0,
    "type":"external",
    "addressFamiliesConfigured":[
      "IPv4 Unicast"
    ],
    "members":{
      "swp1":{
        "status":"Established"
      },
      "swp2":{
        "status":"Established"
      },
      "memberCount":2
    }
  }
}

Signed-off-by: Sindhu Parvathi Gopinathan's <[email protected]>
Copy link
Member

@ton31337 ton31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you fix the styling?

}
if (json)
if (json) {
json_object_int_add(json_peer_group_members,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems similar to the other recent json change proposal - to add a new object that's ... not like the existing objects in the collection.

@ashred-lnx
Copy link
Contributor

Adding my reason why we need this change. This commit is required since we don't want to consumer of this JSON to count again on the dictionary.

@ton31337 ton31337 added this to the 10.2 milestone Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants