summaryrefslogtreecommitdiffstats
path: root/src/ogRest.py
Commit message (Collapse)AuthorAgeFilesLines
* Move check_vm_state_loop() into OgVirtualOperationsRoberto Hueso Gómez2020-05-261-14/+3
| | | | | | Improves code encapsulation by moving check_vm_state_loop method into OgVirtualOperations class. This also fixes import error when running ogclient in 'linux' mode.
* Only import virtual functions when needed.Javier Sánchez Parra2020-05-201-1/+2
| | | | | | | | | ogClient may runs on an OS that do not have all the dependencies needed to use virtual functions. This commit change the behaviour to only import virtual functions when the ogClient has to work with Virtual Machines. This way ogClient works on environments which do not need virtual functions.
* Adapt ogLinuxOperation to work with json config fileJavier Sánchez Parra2020-05-181-1/+1
| | | | | | | ogClient changed its config file format to json. This patch adapts ogLinuxOperation to use new config file. Co-authored-by: Roberto Hueso <rhueso@soleta.eu>
* Wait before polling QMP for host poweroffRoberto Hueso Gómez2020-05-141-2/+2
| | | | | This patch waits before polling qemu with QMP so that it has time to be ready for requests. It also increases wait time in case the host machine is slow.
* Rename operation 'execCMD' to 'shellrun'Roberto Hueso Gómez2020-05-131-1/+1
| | | | This patch also ignores calls to shellrun when virtual mode is activated.
* Switch config file to jsonRoberto Hueso Gómez2020-05-131-4/+5
| | | | | This patch makes configuration parsing easier as well as making the full configuration available in many subclasses.
* Poweroff when no VM and no jobs are runningRoberto Hueso Gómez2020-05-111-1/+14
| | | | | | This patch calls poweroff in virtual mode when no VM is running and no jobs are being executed. This is useful when the guest OS shutdowns so that the host OS does not continue to run.
* Avoid killing ogclient in virtual modeRoberto Hueso Gómez2020-04-201-8/+8
|
* Avoid writting /software output to a fileRoberto Hueso Gómez2020-04-171-5/+4
|
* Use samba for create and restore virtual partitionsRoberto Hueso Gómez2020-04-171-1/+2
| | | | This requires to configure user and password for samba repositories.
* Fix reboot and poweroff threads argsRoberto Hueso Gomez2020-04-131-2/+2
|
* Add mode selection for ogClientRoberto Hueso Gomez2020-04-081-17/+25
|
* rename getURI to get_uri in restRequestOpenGnSys Support Team2020-03-091-1/+1
|
* rename execcmd to shellrunOpenGnSys Support Team2020-03-091-2/+2
|
* Put state to IDLE after run/scheduleRoberto Hueso Gómez2020-03-031-0/+1
|
* Send complete HTTP header when response has no bodyRoberto Hueso Gómez2020-03-021-1/+2
|
* Rename operation to methodOpenGnSys Support Team2020-02-261-4/+4
| | | | As defined by the HTTP standard.
* Modify way to close PID processAlvaro Neira Ayuso2020-02-241-12/+17
| | | | | | With our client disconnection, we hid that the ogClient process will be closed too. This new way only close the subprocess keeping the ogClient still working.
* Use state machine to avoid race condition problemsAlvaro Neira Ayuso2020-02-231-11/+63
| | | | | | This patch allows us to control the thread using a state machine. This state machine controls if the client is busy or not. This new way to control the threads give us more control for avoiding race condition problems.
* pep-0008 cleanupOpenGnSys Support Team2020-02-211-38/+38
| | | | | | | From pep-0008: Method Names and Instance Variables Use the function naming rules: lowercase with words separated by underscores as necessary to improve readability.
* Use 'with' keyword for file readingRoberto Hueso Gómez2020-02-051-9/+4
| | | | | | This is applied to /software and /hardware file reads. We should use 'with' instead of opening and closing a file since this prevents that files stay open after an exception is raised.
* Fix /image/restore execution and responseRoberto Hueso Gómez2020-02-051-0/+5
|
* Fix /image/create execution and responseRoberto Hueso Gómez2020-02-051-5/+2
|
* Fix /setup execution and responseRoberto Hueso Gómez2020-02-031-8/+2
|
* Fix parseGetConf(...) configuration parsingRoberto Hueso Gómez2020-02-031-5/+6
| | | | This patch also reformats the response to the /refresh command.
* add space after Content-Length and Content-TypeOpenGnSys Support Team2020-01-281-2/+2
| | | | ogAdmServer needs this space to work fine.
* Change POST /refresh to GET /refreshRoberto Hueso Gómez2020-01-211-2/+2
| | | | | This patch changes the HTTP method for /refresh and cleans up the implementation of the /refresh Linux operator.
* Fix /software command Linux operationRoberto Hueso Gómez2020-01-211-3/+3
| | | | | This patch runs the script InventarioSoftware with the right arguments. This also increases the recv buffer size for the test server.
* Fix /shell/run commands splittingRoberto Hueso Gómez2020-01-211-1/+1
| | | | This patch splits shell commands either with ';' or '\n'.
* Fix /hardware command Linux operationRoberto Hueso Gómez2020-01-211-2/+2
| | | | This patch runs the script InventarioHardware with the right arguments.
* (Clean-Up) Rename all the functions in ogRest to new ones more clearsAlvaro Neira Ayuso2020-01-191-35/+25
|
* (Clean-Up) Rename HTTPParser file to restRequestAlvaro Neira Ayuso2020-01-191-1/+1
|
* (Clean-Up) Modify restResponse to get the response using constructor and get ↵Alvaro Neira Ayuso2020-01-191-40/+81
| | | | function
* (Clean-Up) Rename HTTPParser to restRequestAlvaro Neira Ayuso2020-01-191-48/+48
|
* (Clean-Up) Rename cmd function/variables to use "run" syntaxAlvaro Neira Ayuso2020-01-191-1/+1
|
* Improve /image/create command responseAlvaro Neira Ayuso2020-01-191-0/+7
| | | | | | | | | | | With this new patch, the image/create command will create a response message with more information for the server. The new format is: {"disk" : "1", "partition" : "1", "code" : "1", "id" : "1", "name" : "test", "repository" : "192.168.2.4", "software" : "xyz"} "xyz" will be the output saved during the execution of InventarioSoftware in a specific path.
* Add Refresh commandAlvaro Neira Ayuso2020-01-191-0/+19
| | | | | | | | | | | | This patch allows us to execute refresh command using ogClient. This command gets all the configuration in our machine and send this information to the server. The format of the message that ogClient will send to the server will be: {"disk": "1", "partition_setup": [{"partition": "1", "code": "LINUX", "filesystem": "NTFS", "size": "498688", "format": "0"}, {"partition": "2", "code": "LINUX", "filesystem": "NTFS", "size": "498688", "format": "0"}, {"partition": "3", "code": "LINUX", "filesystem": "NTFS", "size": "498688", "format": "0"}]}
* Add image/create command for creating a new imageAlvaro Neira Ayuso2020-01-191-0/+20
| | | | | | | | | | | | | | | | This patch allows us to use a new support for creating images using ogClient. ogClient receives from the server a message which json body must be: {"disk" : "1", "partition" : "1", "code" : "1", "id" : "1", "name" : "test", "repository" : "192.168.2.4" } ogClient returns to the server the software inventory executed before create the image. The message for the server is: { "disk" : "0", "partition" : "1", "software" : "xyz" } "xyz" will be the output saved during the execution of InventarioSoftware in a specific path.
* (BUG) Include client parameter in restore commandAlvaro Neira Ayuso2020-01-191-1/+1
|
* Include License headerAlvaro Neira Ayuso2020-01-191-0/+8
|
* Add stop commandAlvaro Neira Ayuso2020-01-191-18/+45
| | | | | This patch includes a new support for stopping all the process running on the ogClient.
* Execute cmd command using threadAlvaro Neira Ayuso2020-01-191-19/+18
| | | | This patch prepares the code for future stop command.
* Fix echo check for process_shellrun in ogRestRoberto Hueso Gómez2020-01-191-1/+1
|
* Change /probe from GET to POST in ogClientRoberto Hueso Gómez2020-01-191-3/+3
|
* Adapt client responses to the server'sRoberto Hueso Gómez2020-01-191-6/+9
| | | | Header parameters need to be sorted for the test server.
* Include echo option for returning shell outputAlvaro Neira Ayuso2020-01-191-17/+7
| | | | | | | | | This patch adds a new echo option in /shell/run command. In case that the option is set up to true, the server will receive in the response a json with the shell output. Otherwise, the server will receive a response message without json body. A side effect of this change is that the command /shell/output/ disapears.
* Send OPG (opengnsys) status when a probe command is receivedAlvaro Neira Ayuso2020-01-191-1/+3
|
* Improve setup command responseAlvaro Neira Ayuso2020-01-191-4/+9
| | | | | | | | | | This patch adds a new response support. This way allows us to send a new response message with more information about the partitions already set up. The format of the response is: { "disk" : "1", "cache" : "1", "cache_size" : "0", "partition_setup": [{"partition": "1", "code": "LINUX", "filesystem": "EMPTY", "size": "498688", "format": "0"}...]
* Catch execution errors during restore image commandAlvaro Neira Ayuso2020-01-191-5/+9
| | | | | | This patch allows us to send feedback to the server in case of error during the execution of the command. In case of error, ogClient will send an "Internal Error" http message.
* Improve hardware command response behaviorAlvaro Neira Ayuso2020-01-191-5/+14
| | | | | | | | | | | This patch give us a better support in case of error or success execution. In error cases, the new behavior is to send an Internal Error http message (500). Otherwise, the server will receive a message with a json with this format: { "hardware" : "xyz" } "xyz" is the output saved in a specific path during the execution of InventarioHardware.