summaryrefslogtreecommitdiffstats
path: root/admin/WebConsole/includes/restfunctions.php
Commit message (Collapse)AuthorAgeFilesLines
* #1021 remove LOG_INFO syslogJavier Sánchez Parra2021-02-041-2/+0
| | | | | | | Some distros enable *.* in syslog.conf to add all logging information to /var/log/syslog. The existing LOG_INFO syslog() entry that WebConsole generates fill up the log files very quickly. It writes every time WebConsole calls ogServer. Remove the LOG_INFO syslog() call.
* #1008 Restore support for >4 partitionsJavier Sánchez Parra2021-01-121-1/+3
| | | | | | | | | | | | | WebConsole "Partition and Format"/"Particionar y Formatear" supported more than 4 partitions when it used SocketHidra. When we changed it to use HTTP requests we introduced a limit of 4 partitions. This commit: * Restores "Partition and Format" support for more than 4 partitions. * Adapts client-side checks (JavaScript) for more than 4 partitions and GPT.
* #1008 Add support to work with GPT tablesJavier Sánchez Parra2020-11-271-8/+10
| | | | | | | | | | | | | | | | | | WebConsole needs to rely on /shell/run to work with GPT tables. Because "Partition and Format"/"Particionar y Formatear" form always supposes that the partition table is MBR/MSDOS. "Setup"/"Configurar" script from "Cloning Engine" also supposes that the partition table is MBR/MSDOS. But it uses "Boot.lib" library, that can create MBR and GTP partitions. This commit: * Adds WebConsole support to work with GPT tables. - Adds input field where the user can select between MSDOS and GPT table types. * Adds "Setup" support to work with GPT tables. - Adds script parameter that expects a string with "MSDOS" or "GPT".
* #988 Read API token from new json configRoberto Hueso Gómez2020-10-061-2/+2
| | | | | This patch reads configuration from the new json file instead of using the legacy '.cfg' file.
* #1001 Remove trailing \r and \n in some scriptsJavier Sánchez Parra2020-08-251-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | We find that scripts sent by "Assistants"/"Asistentes" are losing the last character and scripts send by "Run Script"/"Ejecutar Script" have a trailing line feed (\n). This is happening because shell() function, which calls "/shell/run" of ogServer REST API, expects scripts send by "Asistentes" and "Run Script" to have two trailing characters and removes them. But "Assistants" only put one trailing char (\r) and "Run Script" put three trailing chars (\n\n\r). To avoid problems when running scripts without the last char or with trailing line feed this patch updates WebConsole to: 1) "Assistants" no longer put one trailing character at the end of the script 2) "Run Script" no longer puts three trailing characters at the end of the script 3) shell() expects no trailing chars in scripts sent by "Assistants" and "Run Script".
* #980 Update POST /mode to the new ogServer APIRoberto Hueso Gómez2020-08-141-2/+2
| | | | | This patch selects the machines whose modes need to be changed using the client's IP rather than their scope names.
* Change GET and POST /modes URI to /modeRoberto Hueso Gómez2020-08-031-2/+2
| | | | This adapts to the ogServer.
* #993 Send REST request in createBootMode(...)Roberto Hueso Gómez2020-07-291-0/+10
| | | | | This patch replaces a call to the 'setclientmode' script in createBootMode() function for a REST request to the ogServer.
* #990 Use client broadcast address on WoLJavier Sánchez Parra2020-07-031-2/+4
| | | | | | | | | | | | | | | | Some universities have computers in a different subnet where the ogServer is, but ogServer WoL functionality only supported to send packet to its own subnets. This commit solves this. Now ogServer sends two WoL packets per client, one with the broadcast address of the interface indicated in the config file, the other with the broadcast address calculated with the address and netmask of the client. To ensure that the second WoL works correctly you must configure correctly the IP and netmask of the clients. Also, you have to configure the network of your organization to route WoL packet to the correct subnet.
* #986 Rename to ogserverJavier Sánchez Parra2020-06-191-1/+1
| | | | Step forward to rename all ogAdmServer references to ogServer
* #942 Fix immediate procedures (web)Javier Sánchez Parra2020-06-021-0/+5
|
* #942 schedule commands (web)Javier Sánchez Parra2020-06-021-5/+21
|
* #942 Add weeks and week_days to the webconsole schedule (web)Javier Sánchez Parra2020-06-021-2/+6
|
* #942 Use both task_id and schedule_id in /schedule/get (web)OpenGnSys Support Team2020-06-021-3/+5
|
* #942 Adapt web to use /schedule get on /schedule/create (web)Roberto Hueso Gómez2020-06-021-0/+11
|
* #942 Implement update schedule (web)Roberto Hueso Gómez2020-06-021-0/+21
|
* #915 Add new case to command shell/run (web)Javier Sánchez Parra2020-06-021-7/+15
| | | | | | | | | | | | | | | I tried to delete a cache image but the character "*" of the command was missing so the command fails. Command received: "rm -r /opt/opengnsys/cache/opt/opengnsys/images/test." Command expected: "rm -r /opt/opengnsys/cache/opt/opengnsys/images/test.*" This command adds a new case to the call shell/run. This new case is needed because in the case of deleting a image from the cache the web only has to delete the last character of the string instead of last two characters.
* #942 Fix run script encoding (web)Roberto Hueso Gómez2020-06-021-1/+2
| | | | Run script commands should not be encoded as an URL.
* #942 add create/delete schedule api to web (web)Javier Sánchez Parra2020-06-021-0/+37
| | | | Web updates for #942 Add support for scheduled tasks and commands
* #942 Add /run/task to API REST (web)OpenGnSys Support Team2020-06-021-0/+7
|
* #915 Rename POST /image/setup for /setup in REST APIRoberto Hueso Gómez2019-11-131-1/+1
| | | | This patch renames the setup command to avoid semantic confusion.
* #915 Adapt web to use 'echo' parameter of POST /shell/runRoberto Hueso Gómez2019-11-121-2/+8
|
* #915: Remove duplicate parameter definitions in `restfunctions.php`.Ramón M. Gómez2019-10-301-3/+0
|
* #915 Fix run script commandRoberto Hueso Gómez2019-10-301-0/+3
| | | | | This patch fixes run script command as it now uses REST API instead of SocketHidra.
* #915 Adapt web to use the new run/schedule cmd in REST APIRoberto Hueso Gómez2019-10-251-0/+7
| | | | | | This patch implements run/schedule in the set of available PHP functions. It also replaces old SocketHidra commands by run/schedule in gestor_colasacciones.php and gestor_ejecutaracciones.php.
* #915 Change WebConsole to read API token from ogAdmServer.cfgJavier Sánchez Parra2019-10-141-2/+2
| | | | | | | | | | This commit changes restfunctions.php to read the API token of ogAmdServer from ogAdmRepo.cfg to ogAdmServer.cfg. This way it avoids possible communication errors if ogAdmRepo.cfg and ogAdmServer.cfg are desynced. In order to restfuntions.php can read ogAdmServer.cfg this commit also changes the permissions of the file.
* #915 Fix POST "software" cmd in ogAdmServer and webJavier Sánchez Parra2019-10-111-2/+8
| | | | | | | | | | | | | | | | | | This patch adds the parameters "disk" and "partition" to POST "software" command. This way the client can create a software profile without failure. New request: POST /software { "clients":[ "192.168.56.12" ], "disk":"1", "partition":"1" } Reply: 200 OK
* #915 Adapt web to use new image/restore/incremental cmd in REST APIJavier Sánchez Parra2019-10-111-0/+53
| | | | SocketHidra command has been replaced by POST image/restore/incremental.
* #915 Adapt web to use new REST API "image/create/incremental" commandRoberto Hueso Gómez2019-10-111-0/+48
| | | | SocketHidra command has been replaced by POST "image/create/incremental".
* #915 Adapt web to use new image/restore/basic cmd in REST APIJavier Sánchez Parra2019-10-091-0/+55
| | | | SocketHidra command has been replaced by POST image/restore/basic.
* #915 Adapt web to use new image/create/basic cmd in REST APIJavier Sánchez Parra2019-10-081-1/+55
| | | | SocketHidra command has been replaced by POST image/create/basic.
* Adapt web to use new image/setup cmd in REST APIRoberto Hueso Gómez2019-10-071-0/+53
| | | | SocketHidra configurar has been replaced by POST image/setup.
* #915: adapt web to use OG_REST_PARAM_ID constantJavier Sánchez Parra2019-10-031-1/+1
| | | | | Update restore_image() in restfunctions.php to use OG_REST_PARAM_ID constant.
* #915: Adapt web to use new image/restore cmd in REST APIRoberto Hueso Gómez2019-10-011-0/+26
| | | | SocketHidra restaurar imagen has been replaced by POST image/restore.
* #915: Adapt web to use new image/create cmd in REST APIRoberto Hueso Gómez2019-10-011-0/+29
| | | | SocketHidra crear imagen has been replaced by POST /imagen/create.
* #834: Setting a default value for some PHP variables to avoid warnings.Ramón M. Gómez2019-08-221-3/+7
|
* #915 do not print misleading API error on web consoleJavier Sánchez Parra2019-07-311-1/+1
| | | | | | | | Irina reports a raw array showing in the web console when calling the new ogAdmServer API. var_export() prints the error message on the web instead of syslog. Changing var_export() for print_r() solves this bug.
* #915 adapt web to use new software cmd in REST APIJavier Sánchez Parra2019-07-031-0/+10
| | | | | SocketHidra software (inventario software) has been replaced by POST /software.
* #915 adapt web to use new hardware cmd in REST APIJavier Sánchez Parra2019-07-031-0/+10
| | | | | SocketHidra hardware (inventario hardware) has been replaced by POST /hardware.
* #915 Correct config file route in web API REST libJavier Sánchez Parra2019-06-251-1/+1
| | | | | The "magic" constant __DIR__ ensure a correct route regardless of where the methods are used
* #915 Add API token to common_request() in web consoleJavier Sánchez Parra2019-06-241-0/+6
| | | | Add token parameter in REST API infrastructure in the web console.
* #915 Remove unused parameter to common_request()Javier Sánchez Parra2019-06-121-1/+1
| | | | Remove unused parameter in REST API infrastructure.
* #915 The order of the json field is irrelevant in GET /clientsJavier Sánchez Parra2019-06-111-1/+3
| | | | | | | | | | Either: { "addr" : "192.168.2.1", "state" : "OPG" } or: { "state" : "OPG", "addr" : "192.168.2.1" } should be accepted, this patch updates the web console parser to accept both.
* #915 adapt web console to use new refresh command in REST APIJavier Sánchez Parra2019-05-301-0/+10
| | | | SocketHidra "actualizar" has been replaced by POST /refresh.
* #915 adapt web console to use new stop command in REST APIJavier Sánchez Parra2019-05-301-1/+11
| | | | SocketHidra "purgar" has been replaced by POST /stop.
* #915 adapt web console to use new reboot command in REST APIJavier Sánchez Parra2019-05-301-0/+10
| | | | SocketHidra reboot has been replaced by POST /reboot.
* #915 adapt web console to use new poweroff command in REST APIJavier Sánchez Parra2019-05-301-0/+10
| | | | SocketHidra poweroff has been replaced by POST /poweroff.
* #915 adapt web console to use new REST API in OgAdmServerOpenGnSys Support Team2019-05-271-1/+136
| | | | | | Use new REST API in ogAdmServer. This allows us to start removing the old SockHidra code.
* #834: Remove all redundant PHP closing tags.Ramón M. Gómez2019-01-231-1/+1
|
* #730: Corregir errata al obtener bancos de memoria en inventario de ↵ramon2017-12-211-1/+1
| | | | | | hardware; crear fichero de comandos Windows si no existe al añadir el primero de ellos y subir el timeout de conexiones REST a 500 ms. git-svn-id: https://opengnsys.es/svn/branches/version1.1@5542 a21b9725-9963-47de-94b9-378ad31fedc9