summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix echo check for process_shellrun in ogRestRoberto Hueso Gómez2020-01-191-1/+1
|
* Add /shell/run testsRoberto Hueso Gómez2020-01-191-0/+65
| | | | | | | | These tests cover: - Correct request with echo - Correct request without echo - No json request - Malformed json request
* 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.
* Fix ogClient socket.error typoRoberto Hueso Gómez2020-01-191-1/+2
|
* Add /probe testsRoberto Hueso Gómez2020-01-191-0/+42
| | | | | | | These tests cover: - Correct request - No json request - Malformed json request
* Add unit testing basic structureRoberto Hueso Gómez2020-01-194-0/+66
|
* Change ogClient.py encoding from dos to unixRoberto Hueso gomez2020-01-191-123/+123
|
* Include echo option for returning shell outputAlvaro Neira Ayuso2020-01-192-17/+15
| | | | | | | | | 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-192-5/+31
| | | | | | | | | | 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-192-6/+14
| | | | | | 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-192-6/+19
| | | | | | | | | | | 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.
* Improve software command response behaviorAlvaro Neira Ayuso2020-01-192-7/+24
| | | | | | | | | | | | | | | During our tests, we found some limitation during the execution of the software command. We don't manage errors during the execution of this command. Moreover, the server needs some information in case that everything is OK. This patch modified the code for controlling the errors during the execution, returning an "Internal Error" http message (500). Moreover, in case that everything is OK, ogClient sends a message with this json body: { "disk" : "0", "partition" : "1", "software" : "xyz" } "xyz" will be the output saved during the execution of InventarioSoftware in a specific path.
* Catch execution errors during init session commandAlvaro Neira Ayuso2020-01-192-41/+53
| | | | | | This patch allows us to catch an exception when something wrong is happening executing the init session command. In error cases, ogClient sends an internal error http message to the server. Otherwise, an OK http message.
* Modify methods to use less argumentsAlvaro Neira Ayuso2020-01-192-34/+51
| | | | | | Now, all the arguments are received from httpparser. Those arguments convert the function in long lines of codes. Passing directly the httpparser, all the function will have less arguments and will be more clear the code.
* Add restore/image command for restoring images on the machineAlvaro Neira Ayuso2020-01-193-0/+53
| | | | | | | | | 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"}
* Add setup command for configuring the machineAlvaro Neira Ayuso2020-01-193-1/+38
| | | | | | | | | | ogAdmClient has a support to configure the machines. This new command allows the new ogClient to execute the same script to configure the machine. The json format sent from the server must be: { "disk" : "1", "cache" : "0", "cache_size" : "70000000",\ "partition_setup": [{"partition": "1", "code": "NTFS", "filesystem": "NTFS",\ "size": "11000000", "format": "0"}]}
* Add schedule commandAlvaro Neira Ayuso2020-01-191-0/+5
| | | | No action executed. This command only return a 200 OK message.
* Add hardware command to inventory the machine hardwareAlvaro Neira Ayuso2020-01-192-0/+16
| | | | | | ogAdmClient has a support to inventory the hardware in a machine. This new command allows the new ogClient to execute the same script to inventory the hw. No arguments needed for executing the command
* Add software command to inventory the machine softwareAlvaro Neira Ayuso2020-01-192-0/+16
| | | | | | | | ogAdmClient has a support to inventory the software in a machine. This new command allows the new ogClient to execute the same script to inventory the sw. The arguments will be received from the server as a json message. Format: { "disk" : "0", "partition" : "1"}
* Add session command to init the opengnsys sessionAlvaro Neira Ayuso2020-01-194-3/+36
| | | | | | | | ogAdmClient has a support for initializing the session in the machine. This new command allows the new ogClient to execute the same script to init the session. The arguments will be received from the server as a json message. Format: { "disk" : "0", "partition" : "1"}
* Set up the ip server for working in localhost by defaultAlvaro Neira Ayuso2020-01-191-1/+1
|
* Create new object for creating dynamic json messagesAlvaro Neira Ayuso2020-01-191-12/+19
|
* (BUG) Handling command errorAlvaro Neira Ayuso2020-01-192-3/+13
| | | | | | This patch adds support for handling the error when the command is wrong formed. Now, if we send a shell/run command and the shell command is incomplete, the program crashes.
* Modify Thread methods namesAlvaro Neira Ayuso2020-01-191-4/+4
| | | | This patch modifies the method names to use names more clear.
* Blocks the program execution until a command is processingAlvaro Neira Ayuso2020-01-191-4/+5
| | | | | This patch changes the command process blocking the execution until is processing. Moreover, the response will be OK (200) instead of IN_PROGRESS (202).
* Create ogThread class to move all thread functionsAlvaro Neira Ayuso2020-01-191-16/+17
| | | | | | Right now, all the thread functions are declared inside the processor function. Those functions were created for execute specific commands in the machine (poweroff, reboot, etc). Creating this new class we are cleaning up the code.
* Execute command received using ThreadsAlvaro Neira Ayuso2020-01-191-1/+5
| | | | | Now we are blocking the execution when we apply a command sent from the server. This behavior is unacceptable for our client.
* (BUG) Fix crash when json message received is incompleteAlvaro Neira Ayuso2020-01-191-1/+6
|
* Avoid a broken pipe error on opengnsysAlvaro Neira Ayuso2020-01-191-0/+2
|
* Split the commands taking into account GET/POST operationsAlvaro Neira Ayuso2020-01-191-10/+16
|
* Add shell run and output commandsAlvaro Neira Ayuso2020-01-194-15/+72
| | | | | | | | Opengnsys needs a support to execute commands on the machine. This patch adds the support for executing two new commands "shell/run" and "shell/output". The first one, give us the support for executing a command in the machine and keep save in a queue the output. The second one, give us the support for sending the output from the command executed.
* Merge ogRest and ogProcess to have only one classAlvaro Neira Ayuso2020-01-193-52/+51
|
* Include disconnect and send function on client sideAlvaro Neira Ayuso2020-01-192-16/+26
| | | | | | | | | To disconnect the socket or send a message we use in different parts of the code the attribute socket which is declared inside of the client. This way will create us important problem in the future if we want to change the behavior in our client sockets. This patch adds two new methods inside the client and we can use them in other classes giving us the easy way to send messages and disconnect the client.
* Add global variable to set up OpenGnsys pathAlvaro Neira Ayuso2020-01-191-2/+4
| | | | | | This variable allow us to modify the opengnsys path without modify several parts of the code. This change reduces the probability to add any bug forgetting to change any line.
* Add ogRest class to generate API Rest ResponsesAlvaro Neira Ayuso2020-01-193-9/+31
| | | | | This class now, allow us to generate API Rest responses. In the future, the idea is to complete this class with get and post messages if it's needed.
* Port program to Python 3Alvaro Neira Ayuso2020-01-194-20/+22
| | | | | Python 2.7 will be deprecated in January of 2020. So, we need to have the program with a supported api.
* Remove remote from cfg fileAlvaro Neira Ayuso2020-01-191-2/+0
| | | | | This information is older for this version. We don't need to have any information about the remote.
* Remove unneeded logsAlvaro Neira Ayuso2020-01-191-2/+0
|
* Include the reboot support in ogOperationAlvaro Neira Ayuso2020-01-191-2/+4
| | | | | This new patch allows us to reboot the linux machine using reboot binary or in OpenGnsys client case, use the specific script.
* Include the poweroff support in ogOperationAlvaro Neira Ayuso2020-01-191-1/+7
| | | | | This new patch allows us to turn off the linux machine using poweroff binary or in OpenGnsys client case, use the specific script.
* Add Probe HTTP CommandAlvaro Neira Ayuso2020-01-191-0/+2
|
* Remove unneeded logsAlvaro Neira Ayuso2020-01-191-3/+0
|
* Send bad request when the APIRest operation is not supportedAlvaro Neira Ayuso2020-01-192-3/+8
| | | | | | | | | | | | | | Our program sends always the HTTP message: HTTP/1.0 200 OK but if the operation sent is not supported, we are sending the same correct message. This patch add the support to check if the message is supported. If the message is not supported, we are going to send: HTTP/1.0 400 Bad request\r\n\r\n Otherwise, in operations supported: HTTP/1.0 200 OK
* Add new process support for reboot messageAlvaro Neira Ayuso2020-01-192-0/+11
|
* Execute socket loop on run socket functionAlvaro Neira Ayuso2020-01-192-19/+21
| | | | Ported code from main function to a client function for clearing the main loop.
* Add ogProcess and ogOperation for linuxAlvaro Neira Ayuso2020-01-194-0/+28
| | | | | Thoses new classes allows us to process and execute commands from server side sent using HTTP format.
* Add HTTP parser supportAlvaro Neira Ayuso2020-01-192-11/+58
| | | | | | The new OpenGnsys support to communicate server and client side will be HTTP. This new class allows us the support for parsing all the message received from the server in HTTP format.
* Modify Client state to use enumAlvaro Neira Ayuso2020-01-192-12/+11
| | | | | | | | | During our connections, we are using states to control the Client Socket. We defined using global variables. In case that we modify this global variable, we need to change it in serveral parts of the code. Using enums and declaring a new class, we can redefine the values or create new states without changing the same code in differents python files.