mirror of https://git.48k.eu/ogclient
Split the commands taking into account GET/POST operations
parent
e20daf639d
commit
6764fc44e1
|
|
@ -42,16 +42,22 @@ class ogRest():
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
def processOperation(self, op, URI, cmd, client):
|
def processOperation(self, op, URI, cmd, client):
|
||||||
|
if ("GET" in op):
|
||||||
|
if ("probe" in URI):
|
||||||
|
self.process_probe(client)
|
||||||
|
elif ("shell/output" in URI):
|
||||||
|
self.process_shellout(client)
|
||||||
|
else:
|
||||||
|
client.send(self.getResponse(ogResponses.BAD_REQUEST))
|
||||||
|
elif ("POST" in op):
|
||||||
if ("poweroff" in URI):
|
if ("poweroff" in URI):
|
||||||
self.process_poweroff(client)
|
self.process_poweroff(client)
|
||||||
elif ("reboot" in URI):
|
elif ("reboot" in URI):
|
||||||
self.process_reboot(client)
|
self.process_reboot(client)
|
||||||
elif ("probe" in URI):
|
|
||||||
self.process_probe(client)
|
|
||||||
elif ("shell/run" in URI):
|
elif ("shell/run" in URI):
|
||||||
self.process_shellrun(client, cmd)
|
self.process_shellrun(client, cmd)
|
||||||
elif ("shell/output" in URI):
|
else:
|
||||||
self.process_shellout(client)
|
client.send(self.getResponse(ogResponses.BAD_REQUEST))
|
||||||
else:
|
else:
|
||||||
client.send(self.getResponse(ogResponses.BAD_REQUEST))
|
client.send(self.getResponse(ogResponses.BAD_REQUEST))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue