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

[Sonic-config-engine]: View acls and ports or specifc port configs on sonic switch (Json) #3036

Closed
wants to merge 1 commit into from

Conversation

prprakas
Copy link

@prprakas prprakas commented Jun 19, 2019

Following features are added as the part of this PR, this only involves changes done to sonic-config-engine, I will submit a PR for changes done on sonic-utilities.

  1. View acl configs
  2. View port configs (like speed , lanes index etc)
  3. View specific port configs

Signed-off-by: Prem Prakash prprakash@linkedin.com

- What I did
To view port configs and acl configs, added the support to sonic-config-engine and implemented the show commands for it
- How I did it
Modified sonic-cfggen file to add the support for acl and port running config. Even main.py file is modified under sonic-utilities/show folder.
- How to verify it
built sonic-utilities deb package and installed it and also changed the sonic-cfggen file in the switch under /usr/local/bin/sonic-cfggen

Added options interface and accesslist to the runningconfiguration option

admin@lnos-x1-a-csw02:~$ show runningconfiguration ?
Usage: show runningconfiguration [OPTIONS] COMMAND [ARGS]...

Show current running configuration information

Options:
-?, -h, --help Show this message and exit.

Commands:
accesslist Show acl running configuration
all Show full running configuration
bgp Show BGP running configuration
interface Show port running configuration
interfaces Show interfaces running configuration
ntp Show NTP running configuration
snmp Show SNMP information
admin@lnos-x1-a-csw02:~$

ACL config-

admin@lnos-x1-a-csw02:$ show runningconfiguration accesslist
{
"ACL_RULE": {
"NO-NSW-PACL-V4|DEFAULT_DENY": {
"PACKET_ACTION": "DROP",
"IP_TYPE": "IPv4ANY",
"PRIORITY": "0"
},
"NO-NSW-PACL-V4|Rule_20": {
"PACKET_ACTION": "FORWARD",
"DST_IP": "X.X.X.X/24",
"SRC_IP": "X.X.0.0/16",
"IP_TYPE": "IPv4ANY",
"PRIORITY": "999980"
}
}
}
admin@lnos-x1-a-csw02:
$

Port configs-

admin@lnos-x1-a-csw02:~$ show runningconfiguration interface
{
"PORT": {
"Ethernet0": {
"index": "1",
"lanes": "65,66,67,68",
"mtu": "9100",
"alias": "Eth1",
"admin_status": "up",
"speed": "100000"
},
"Ethernet4": {
"index": "2",
"lanes": "69,70,71,72",
"mtu": "9100",
"alias": "Eth2",
"admin_status": "up",
"speed": "100000"
},
"Ethernet8": {
"index": "3",
"lanes": "73,74,75,76",
"mtu": "9100",
"alias": "Eth3",
"admin_status": "up",
"speed": "100000"
},
"Ethernet12": {
"index": "4",
"lanes": "77,78,79,80",
"mtu": "9100",
"alias": "Eth4",
"admin_status": "up",
"speed": "100000"
}
}

Port config for a specific port-

admin@lnos-x1-a-csw02:$ show runningconfiguration interface Ethernet0
{
"Ethernet0": {
"admin_status": "up",
"alias": "Eth1",
"index": "1",
"lanes": "65,66,67,68",
"mtu": "9100",
"speed": "100000"
}
}
admin@lnos-x1-a-csw02:
$

@prprakas
Copy link
Author

retest this please

@prprakas prprakas changed the title [Sonic-buildimage]: View acls and ports or specifc port configs on sonic switch (Json) [Sonic-config-engine]: View acls and ports or specifc port configs on sonic switch (Json) Jun 19, 2019
@prprakas
Copy link
Author

retest this please

@prprakas
Copy link
Author

retest vs please

@prprakas
Copy link
Author

retest this please

@prprakas
Copy link
Author

retest vs please

@prprakas
Copy link
Author

@lguohan addressed your comments. Please have a look.

@lguohan
Copy link
Collaborator

lguohan commented Jul 19, 2019

@prprakas , I am not sure I understand your point, the show interface neighbor expected is broken due to this PR, i think.

Copy link
Collaborator

@lguohan lguohan left a comment

Choose a reason for hiding this comment

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

please fix show interface neighbor expected

@prprakas
Copy link
Author

@lguohan Understood, fixed it under sonic-net/sonic-utilities#584. It seems to be good now, please have a look.

lguohan pushed a commit to sonic-net/sonic-utilities that referenced this pull request Jul 23, 2019
…nder sonic-buildimage/pull/3036 (#584)

- What I did
Fixed show interface neigh expected which was broken because of sonic-net/sonic-buildimage#3036

- How I did it
There was a change in the output format for --var-json option in sonic-config-engine,changes had to be done for show commands as well.
@lguohan
Copy link
Collaborator

lguohan commented Jul 23, 2019

@prprakas, thanks for the PR. can you update the sonic-utilities submodule in the PR?

@prprakas
Copy link
Author

@prprakas, thanks for the PR. can you update the sonic-utilities submodule in the PR?

@lguohan If I understand correctly, I think you are asking for the changes in sonic-utilities for the corresponding show commands. That change was already submitted under sonic-net/sonic-utilities#557 along with this PR and has already been approved.

@lguohan
Copy link
Collaborator

lguohan commented Jul 23, 2019

for this PR, you should include submodule update for that repo.

@lguohan
Copy link
Collaborator

lguohan commented Jul 25, 2019

can you resolve the conflict?

@lguohan
Copy link
Collaborator

lguohan commented Aug 2, 2019

there are still conflict.

@prprakas prprakas force-pushed the acl_port_runconfig branch 7 times, most recently from 8cb350b to 32e1ee9 Compare August 7, 2019 06:08
…n format)

Using --var-json to display the acl and ports/specific port configs

Editing the test(var_json_test) assertion due to change in output format of command

Adding test for the interface argument added to Sonic config engine

Test for the interface argument added
@prprakas
Copy link
Author

prprakas commented Aug 7, 2019

@lguohan I think there have been multiple other commits on src/sonic-utilities which are already included in sonic-buildimage https://github.com/Azure/sonic-buildimage/tree/master/src. I think updating src/sonic-utilities is not needed now.

@prprakas
Copy link
Author

prprakas commented Aug 7, 2019

@lguohan any thing has changed I see the older tests are failing ? https://sonic-jenkins.westus2.cloudapp.azure.com/job/vs/job/buildimage-vs-image-pr/601/console.

@lguohan
Copy link
Collaborator

lguohan commented Aug 7, 2019

i think it is the unit test issue, the nightly build succeeded.

@prprakas
Copy link
Author

prprakas commented Aug 8, 2019

retest this please

@prprakas
Copy link
Author

prprakas commented Aug 8, 2019

@lguohan looks like similar change has been added under #3248 and it is approved, I think that is the reason these tests are failing for me ?

@prprakas
Copy link
Author

prprakas commented Aug 9, 2019

@lguohan do you think this PR is needed now, to me it seems like this is already covered in #3248 , let me know what do you think ?

@lguohan
Copy link
Collaborator

lguohan commented Aug 15, 2019

yes, i think we can drop this pr, but can you fix sonic-utilities?

@prprakas prprakas closed this Aug 15, 2019
malletvapid23 added a commit to malletvapid23/Sonic-Utility that referenced this pull request Aug 3, 2023
…nder sonic-buildimage/pull/3036 (#584)

- What I did
Fixed show interface neigh expected which was broken because of sonic-net/sonic-buildimage#3036

- How I did it
There was a change in the output format for --var-json option in sonic-config-engine,changes had to be done for show commands as well.
yxieca pushed a commit that referenced this pull request Dec 14, 2023
…atically (#17457)

src/sonic-utilities

* 1b1402f5 - (HEAD -> 202311, origin/202311) [hash]: Add ECMP/LAG hash algorithm CLI (#3036) (9 days ago) [Nazarii Hnydyn]
* 71514ea3 - Revert "Run yang validation in unit test (#3025)" (#3055) (9 days ago) [Ying Xie]
* b5daf5d4 - [dhcp_relay] Fix dhcp_relay counter display issue (#3054) (9 days ago) [Yaqiang Zhu]
* b3172505 - [sflow][db_migrator] Egress Sflow support (#3020) (9 days ago) [Rajkumar-Marvell]
* 1e813105 - [wol] Implement wol command line utility (#3048) (3 weeks ago) [Zhijian Li]
* 8ebc56a0 - [sonic_installer]: Improve exception handling: introduce notes. (#3029) (3 weeks ago) [Nazarii Hnydyn]
* 3610ce93 - [sonic-package-manager] Fix YANG validation failure on upgrade when feature has constraints in YANG model on FEATURE table (#2933) (3 weeks ago) [Stepan Blyshchak]
* cfd2dd39 - Add container rsyslog.conf to the sys dump (#3039) (4 weeks ago) [Vivek]
* c4b07828 - Support new platform in generic configuration update (#3038) (4 weeks ago) [Stephen Sun]
* a8d236c8 - [fast-reboot-filter-routes.py] Remove click and improve error reporting (#3030) (4 weeks ago) [Stepan Blyshchak]
* 75199c0f - [sonic-package-manager] insert newline in /etc/sonic/generated_services.conf (#3040) (4 weeks ago) [Stepan Blyshchak]
* cd855698 - [VOQ][saidump] Modify generate_dump: replace save_saidump with save_saidump_by_route_size (#2972) (4 weeks ago) [JunhongMao]
* f1e24ae5 - GCU support for Cisco-8000 features (#3010) (4 weeks ago) [rbpittman]
* 67e1c3dc - Update GCU rsyslog validator (#3012) (4 weeks ago) [jingwenxie]
* 253b7975 - [sonic-package-manager] do not modify config_db.json (#3032) (5 weeks ago) [Stepan Blyshchak]
* 177dd8e8 - [sonic-package-manager] add generated service to /etc/sonic/generated_services.conf (#3037) (5 weeks ago) [Stepan Blyshchak]
* 62fcd77a - Configure NTP according to extended configuration (#2835) (5 weeks ago) [Yevhen Fastiuk]
* ced09404 - [dualtor_neighbor_check] Adjust zero-mac check condition (#3034) (5 weeks ago) [Longxiang Lyu]
* a4eeb698 - [config] config reload should generate sysinfo if missing  (#3031) (6 weeks ago) [jingwenxie]
* e01fc891 - Run yang validation in unit test (#3025) (6 weeks ago) [ganglv]
mssonicbld added a commit that referenced this pull request May 11, 2024
…lly (#18935)

#### Why I did it
src/sonic-swss
```
* 198eb3d1 - (HEAD -> master, origin/master, origin/HEAD) Add transceiver info to bake only if supported (#3142) (2 hours ago) [Sudharsan Dhamal Gopalarathnam]
* f62eed23 - [Mellanox] PFC watchdog long term solution to reduce false alarm (#3036) (35 hours ago) [Stephen Sun]
```
#### How I did it
#### How to verify it
#### Description for the changelog
mssonicbld added a commit that referenced this pull request Jul 3, 2024
…lly (#19432)

#### Why I did it
src/sonic-swss
```
* 8fd0837a - (HEAD -> 202311, origin/202311) Add support for ECMP and LAG hash offset (#3138) (4 hours ago) [Kumaresh Perumal]
* 66b9dacf - [Mellanox] PFC watchdog long term solution to reduce false alarm (#3036) (4 hours ago) [Stephen Sun]
* 14add20e - Revamp module build script to make it work for 5.15 on Ubuntu 20.04 (#3212) (7 hours ago) [Saikrishna Arcot]
* 6a347ab4 - Add transceiver info to bake only if supported (#3142) (5 days ago) [Sudharsan Dhamal Gopalarathnam]
```
#### How I did it
#### How to verify it
#### Description for the changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants