Poll

Should I remove the CLI context levels?

Yes, I would prefer a single layer of commands.
3 (60%)
No, I like it how it is.
2 (40%)

Total Members Voted: 5

CLI context levels - Please vote!

  • 4 Replies
  • 2232 Views
*

Paul Zanna

  • Moderator
  • Sr. Member
  • *****
  • 370
    • View Profile
    • Northbound Networks
CLI context levels - Please vote!
« on: April 27, 2016, 05:10:28 PM »
Hi guys,

I've been reviewing the design of the CLI and one thing that I'm considering is the removal of the different context levels (config, openflow, etc.) to make thing a little easier to navigate. What are your thoughts?

Regards,
Paul

*

vk5tu

  • Newbie
  • *
  • 1
    • View Profile
Re: CLI context levels - Please vote!
« Reply #1 on: April 28, 2016, 11:49:27 AM »
Compare

Zodiac_FX# openflow
Zodiac_FX(openflow)# show status
Zodiac_FX(openflow)# exit


with

example# show openflow status

When you are fault finding and want to pump out a lot of "show" commands to get an idea of where the box is at then context levels which you have to explicity enter and leave just get in the way. You can still have implicit contexts for organising, as the "show openflow status" example demonstrates.

Particularly annoying is when you are configuring and forget a configuration command:

Zodiac_FX# config
Zodiac_FX(config)# help                                                         
Unknown command
Zodiac_FX(config)# exit
Zodiac_FX# help
Config:                                                                         
 save                                                                           
 show config                                                                   
 show vlans                                                                     
 set name <name>                                                               
 set mac-address <mac address>                                                 
 set ip-address <ip address>                                                   
 set netmask <netmasks>                                                         
 set gateway <gateway ip address>                                               
 set of-controller <openflow controller ip address>                             
 set of-port <openflow controller tcp port>                                     
 set failstate <secure|safe>                                                   
 add vlan <vlan id> <vlan name>                                                 
 delete vlan <vlan id>                                                         
 set vlan-type <openflow|native>                                               
 add vlan-port <vlan id> <port>                                                 
 delete vlan-port <port>                                                       
 factory reset                                                                 
 set of-version <version(0|1|4)>                                               
 exit
Zodiac_FX# config


Just let me pump out something like:

example# set openflow controller A address 10.9.8.7
example# set openflow controller A port 1234
example# set openflow controller A fail secure


(the "A" being a string to give some way in the syntax for multiple upstream controllers in the future)

For this sort of exercise command autocompletion or abbreviation is a big win.

Don't use "set" for non-configuration items:

example# request openflow rules flush
example# request factory-reset


It would be nice to provide a "show config set" command which displays the configuration as a list of these "set" commands so that I can cut-and-paste. For the normal "show config" you can do that in a way which reminds people of the command syntax:

example# show config
openflow
     controller A
         address 10.9.8.7
         port 1234
         fail secure


Anyway, I hope this contains enough ideas for making the CLI slicker.

*

Elwood_G

  • Newbie
  • *
  • 12
    • View Profile
Re: CLI context levels - Please vote!
« Reply #2 on: April 29, 2016, 08:09:00 AM »
Hi,

I would keep the config level, as most network OSs I have seen have the difference between looking and writing.
The show openflow status instead of openflow -> show status I would like (looks almost like a corsa switch then :)

Regards.

Konstantin

*

Jarrod Bakker

  • Newbie
  • *
  • 5
    • View Profile
Re: CLI context levels - Please vote!
« Reply #3 on: May 01, 2016, 08:10:38 PM »
Shorter commands are always preferable. The environment should aim to decrease the amount of typing done on average to complete a task.

If one were to configure the switch, then requiring the user to enter in "set openflow" before each item would increase the time taken to complete the task. Of course time could be reduced with auto-completion or abbreviations as mentioned by vk5tu but this still requires extra typing for each command. Context levels modularise the CLI and the user's tasks which will decrease the average amount of typing. However, vk5tu makes a good point against this with the following example:

Compare

Zodiac_FX# openflow
Zodiac_FX(openflow)# show status
Zodiac_FX(openflow)# exit


with

example# show openflow status

Why have three commands to complete a task when you could do it with only one? This is where mechanisms such as auto-completion or abbreviations could be used to reduce the amount of typing done. For example:

example# of
example# shw status
example# exit


There are still three commands but number of keystrokes has been reduced. Better yet, you could 'stack' commands in one line so that

example# openflow
example# show status
example# exit


becomes

example# openflow show status
example# exit


This could then be extended with some auto-completion and abbreviations:

example# of shw status
example# exit

*

nexusnet

  • Newbie
  • *
  • 13
    • View Profile
Re: CLI context levels - Please vote!
« Reply #4 on: June 11, 2016, 07:26:48 AM »
Hi Paul,

As previously indicated, I am new to openflow and SDN. My initial impression of working with contexts is that it's like the Cisco CLI - contexts seem helpful in concept, but are in the way in practice. If people are split in their preferences, perhaps a context on|off setting could be added to let individuals choose on the fly?

Tx,
Robert