mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-01 03:07:56 +00:00
renames create_genlink to generic_cx
This commit is contained in:
39
py-json/generic_cx.py
Executable file
39
py-json/generic_cx.py
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
|
||||
if sys.version_info[0] != 3:
|
||||
print("This script requires Python 3")
|
||||
exit()
|
||||
|
||||
from LANforge.lfcli_base import LFCliBase
|
||||
|
||||
class GenericCx(LFCliBase):
|
||||
def __init__(self, lfclient_host, lfclient_port):
|
||||
super().__init__(lfclient_host, lfclient_port)
|
||||
self.lfclient_host = lfclient_host
|
||||
self.lfclient_port = lfclient_port
|
||||
|
||||
def createGenEndp(self, alias, shelf, rsrc, port, type):
|
||||
data = {
|
||||
"alias": alias,
|
||||
"shelf": shelf,
|
||||
"resource": rsrc,
|
||||
"port": port,
|
||||
"type": type
|
||||
}
|
||||
super().jsonPost("cli-json/add_gen_endp", data)
|
||||
|
||||
def setFlags(self, endpName, flagName, val):
|
||||
data = {
|
||||
"name": endpName,
|
||||
"flag": flagName,
|
||||
"val": val
|
||||
}
|
||||
super().jsonPost("cli-json/set_endp_flag", data)
|
||||
|
||||
def setCmd(self, endpName, cmd):
|
||||
data = {
|
||||
"name": endpName,
|
||||
"command": cmd
|
||||
}
|
||||
super().jsonPost("cli-json/set_gen_cmd", data)
|
||||
Reference in New Issue
Block a user