diff options
author | Alvaro Neira Ayuso <aneira@soleta.eu> | 2020-01-03 11:33:25 +0100 |
---|---|---|
committer | Alvaro Neira Ayuso <alvaroneay@gmail.com> | 2020-01-19 19:50:44 +0100 |
commit | cc11d8f38f6a2f9dd46904272808bb25dac042b8 (patch) | |
tree | d960a847ec3bef69e2fd4e91ec06f05e23a1ae76 /src/HTTPParser.py | |
parent | efbe8a7960f5a6f92134fc8b0f4c946a7664a5f0 (diff) |
Add restore/image command for restoring images on the machine
ogAdmClient has a support to restore image on the machine. This new command
allows the new ogClient to execute the same script to restore the images
on the machine. The json format sent from the server must be:
{ "disk" : "1", "partition" : "1", "name" : "test",\
"repository" : "192.168.56.10", "type" : "UNICAST", "profile": "1", "id": "1"}
Diffstat (limited to 'src/HTTPParser.py')
-rw-r--r-- | src/HTTPParser.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/HTTPParser.py b/src/HTTPParser.py index 7ee8972..819cd74 100644 --- a/src/HTTPParser.py +++ b/src/HTTPParser.py @@ -18,6 +18,11 @@ class HTTPParser: self.cache = None self.cache_size = None self.partition_setup = None + self.name = None + self.repo = None + self.type = None + self.profile = None + self.id = None def parser(self,data): self.requestLine, self.headersAlone = data.split('\n', 1) @@ -64,6 +69,21 @@ class HTTPParser: if "partition_setup" in cmd: self.partition_setup = jsoncmd["partition_setup"] + if "name" in cmd: + self.name = jsoncmd["name"] + + if "repository" in cmd: + self.repo = jsoncmd["repository"] + + if "type" in cmd: + self.type = jsoncmd["type"] + + if "profile" in cmd: + self.profile = jsoncmd["profile"] + + if "id" in cmd: + self.id = jsoncmd["id"] + def getHeaderLine(self): return self.headersAlone @@ -105,3 +125,18 @@ class HTTPParser: def getPartitionSetup(self): return self.partition_setup + + def getName(self): + return self.name + + def getRepo(self): + return self.repo + + def getType(self): + return self.type + + def getProfile(self): + return self.profile + + def getId(self): + return self.id |