Commit Graph

109 Commits (cf9577a40edd7c3f8bebcf02aaccb7ef441e7dac)

Author SHA1 Message Date
Alvaro Neira Ayuso e6eba4b91f (BUG) Handling command error
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.
2020-01-19 19:50:44 +01:00
Alvaro Neira Ayuso af903503a2 Modify Thread methods names
This patch modifies the method names to use names more clear.
2020-01-19 19:50:44 +01:00
Alvaro Neira Ayuso b571f40482 Blocks the program execution until a command is processing
This patch changes the command process blocking the execution until is processing.
Moreover, the response will be OK (200) instead of IN_PROGRESS (202).
2020-01-19 19:50:44 +01:00
Alvaro Neira Ayuso 59a28237f1 Create ogThread class to move all thread functions
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.
2020-01-19 19:50:44 +01:00
Alvaro Neira Ayuso d065e1998d Execute command received using Threads
Now we are blocking the execution when we apply a command sent from the server.
This behavior is unacceptable for our client.
2020-01-19 19:50:44 +01:00
Alvaro Neira Ayuso 6764fc44e1 Split the commands taking into account GET/POST operations 2020-01-19 19:50:44 +01:00
Alvaro Neira Ayuso e20daf639d Add shell run and output commands
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.
2020-01-19 19:50:44 +01:00
Alvaro Neira Ayuso dfc97ffedb Merge ogRest and ogProcess to have only one class 2020-01-19 19:50:44 +01:00
Alvaro Neira Ayuso 694bc492a2 Add ogRest class to generate API Rest Responses
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.
2020-01-19 19:50:44 +01:00