Skip to content

Instantly share code, notes, and snippets.

@premchalmeti
Last active July 12, 2021 15:33
Show Gist options
  • Save premchalmeti/dc5323e58948c41f9bda8dfa349b3efc to your computer and use it in GitHub Desktop.
Save premchalmeti/dc5323e58948c41f9bda8dfa349b3efc to your computer and use it in GitHub Desktop.
admin CLI network file for clish parser
<?xml version="1.0" encoding="UTF-8"?>
<CLISH_MODULE xmlns="http://clish.sourceforge.net/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://clish.sourceforge.net/XMLSchema
http://clish.sourceforge.net/XMLSchema/clish.xsd">
<!--=======================================================-->
<PTYPE name="STRING"
pattern="[^\-]+"
help="String"/>
<PTYPE name="IP_ADDR"
pattern="(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))"
help="IP address AAA.BBB.CCC.DDD where each part is in the range 0-255"/>
<!--=======================================================-->
<COMMAND name="network show"
help="Show currently added devices">
<ACTION>network show</ACTION>
</COMMAND>
<!--=======================================================-->
<COMMAND name="network device"
help="Device related commands"></COMMAND>
<!--=======================================================-->
<COMMAND name="network device add">
<PARAM name="device_name" ptype="STRING" help="Name of the device"></PARAM>
<PARAM name="device_ip" ptype="IP_ADDR" help="IP of the device"></PARAM>
<ACTION>network device add ${device_name} ${ip_addr}</ACTION>
</COMMAND>
<!--=======================================================-->
<COMMAND name="network device list">
<ACTION>network device list</ACTION>
</COMMAND>
<!--=======================================================-->
<COMMAND name="network device configure">
</COMMAND>
<!--=======================================================-->
<COMMAND name="network device configure rename">
<PARAM name="old_name" ptype="STRING" help="Current name of the device"></PARAM>
<PARAM name="new_name" ptype="STRING" help="New name of the device"></PARAM>
<ACTION>network device rename ${old_name} ${new_name}</ACTION>
</COMMAND>
<!--=======================================================-->
<COMMAND name="network device configure ip">
<PARAM name="device_name" ptype="STRING" help="Name of the device"></PARAM>
<PARAM name="device_ip" ptype="IP_ADDR" help="IP of the device"></PARAM>
<ACTION>network device configure ip ${device_name} ${ip_addr}</ACTION>
</COMMAND>
</CLISH_MODULE>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment