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-utilities]: Added commands to view acl and port running configs #557

Merged
merged 3 commits into from
Jun 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion doc/Command-Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2785,6 +2785,8 @@ This sub-section explains the show commands for displaying the running configura
3) ntp
4) snmp
5) all
6) acl
7) interface

**show runningconfiguration all**

Expand Down Expand Up @@ -2851,6 +2853,36 @@ This command displays the running configuration of the snmp module.
admin@sonic:~$ show runningconfiguration snmp
```

**show runningconfiguration acl**

This command displays the running configuration of the acls

- Usage:
show runningconfiguration acl


- Example:
```
admin@sonic:~$ show runningconfiguration acl
```

**show runningconfiguration interface <interfacename>**

This command displays the running configuration of the ports

- Usage:
show runningconfiguration interface <interfacename>


- Example:
```
admin@sonic:~$ show runningconfiguration interface
```

```
admin@sonic:~$ show runningconfiguration interface <interfacename>
```

Go Back To [Beginning of the document](#SONiC-COMMAND-LINE-INTERFACE-GUIDE) or [Beginning of this section](#Startup--Running-Configuration)


Expand Down Expand Up @@ -3677,4 +3709,4 @@ Once if users go to "vtysh", they can use the routing stack specific commands as
Refer the routing stack [Quagga Command Reference](https://www.quagga.net/docs/quagga.pdf) or [FRR Command Reference](https://buildmedia.readthedocs.org/media/pdf/frrouting/latest/frrouting.pdf) to know more about about the routing stack configuration.


Go Back To [Beginning of the document](#SONiC-COMMAND-LINE-INTERFACE-GUIDE)
Go Back To [Beginning of the document](#SONiC-COMMAND-LINE-INTERFACE-GUIDE)
23 changes: 23 additions & 0 deletions show/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1329,6 +1329,29 @@ def all(verbose):
run_command(cmd, display_cmd=verbose)


# 'acl' subcommand ("show runningconfiguration acl")
@runningconfiguration.command()
@click.option('--verbose', is_flag=True, help="Enable verbose output")
def acl(verbose):
"""Show acl running configuration"""
cmd = "sonic-cfggen -d --var-json ACL_RULE"
run_command(cmd, display_cmd=verbose)


# 'interface' subcommand ("show runningconfiguration interface <interfacename>")
@runningconfiguration.command()
@click.argument('interfacename', required=False)
@click.option('--verbose', is_flag=True, help="Enable verbose output")
def interface(interfacename, verbose):
"""Show port running configuration"""
cmd = "sonic-cfggen -d --var-json PORT"

if interfacename is not None:
cmd += " {0} {1}".format("--interface", interfacename)

run_command(cmd, display_cmd=verbose)


# 'bgp' subcommand ("show runningconfiguration bgp")
@runningconfiguration.command()
@click.option('--verbose', is_flag=True, help="Enable verbose output")
Expand Down