summaryrefslogtreecommitdiffstats
path: root/src/ogClient.py
Commit message (Collapse)AuthorAgeFilesLines
* Add session command to init the opengnsys sessionAlvaro Neira Ayuso2020-01-191-1/+1
| | | | | | | | 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"}
* Add shell run and output commandsAlvaro Neira Ayuso2020-01-191-2/+2
| | | | | | | | 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-191-3/+3
|
* Include disconnect and send function on client sideAlvaro Neira Ayuso2020-01-191-2/+9
| | | | | | | | | 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 ogRest class to generate API Rest ResponsesAlvaro Neira Ayuso2020-01-191-4/+5
| | | | | 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-191-15/+17
| | | | | Python 2.7 will be deprecated in January of 2020. So, we need to have the program with a supported api.
* Remove unneeded logsAlvaro Neira Ayuso2020-01-191-3/+0
|
* Send bad request when the APIRest operation is not supportedAlvaro Neira Ayuso2020-01-191-3/+4
| | | | | | | | | | | | | | 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
* Execute socket loop on run socket functionAlvaro Neira Ayuso2020-01-191-0/+20
| | | | Ported code from main function to a client function for clearing the main loop.
* Add ogProcess and ogOperation for linuxAlvaro Neira Ayuso2020-01-191-0/+5
| | | | | Thoses new classes allows us to process and execute commands from server side sent using HTTP format.
* Add HTTP parser supportAlvaro Neira Ayuso2020-01-191-11/+4
| | | | | | 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-191-6/+8
| | | | | | | | | 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.
* Create new ogClientAlvaro Neira Ayuso2020-01-191-0/+95
This commit init the new ogClient. The new ogClient has support for configuring and for connecting with the ogAdminServer.