renames create_genlink to generic_cx

This commit is contained in:
Jed Reynolds
2020-06-03 13:41:55 -07:00
parent 551ff33b64
commit d4817c9727
2 changed files with 3 additions and 3 deletions

39
py-json/generic_cx.py Executable file
View 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)