networktocode / netutils

Python library that is a collection of functions and objects for common network automation tasks.
https://netutils.readthedocs.io/
Other
214 stars 48 forks source link

Command Mapper Functionality #180

Open jeffkala opened 1 year ago

jeffkala commented 1 year ago

Environment

Proposed Functionality

Take a theoretical "check" on a service/configuration dataset and get back the command(s) reference based on the platform.

Use Case

As a network ops engineer or automation engineer its not always easy to take a theoretical "check" on a service/configuration dataset and get back the command reference based on the platform. It would be nice to be able to query a python function with a "model type" for example "vlan" or "l2_vlan" + a platform and return the command for that platform.

itdependsnetworks commented 1 year ago

Some chicken scratch from slack

>>> class BaseCommandClass:
...   model = None
...   os = None
...   command = None
...
>>> class IosVlan(BaseCommandClass):
...   model = "Vlan"
...   os = "cisco_ios"
...   command = "show vlan"
...
>>>

Additionally, can look into entry-points for this