Skip to content

Commit

Permalink
[Sonic-utilities]: Added commands to view acl and port running configs (
Browse files Browse the repository at this point in the history
#557)

[show] Add commands to view acl and port running configs
  • Loading branch information
prprakas authored and jleveque committed Jun 25, 2019
1 parent c7f45c3 commit dc52015
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
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

0 comments on commit dc52015

Please sign in to comment.