summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* #1010 Adapt ogServer to send GET /softwareJavier Sánchez Parra2020-12-021-1/+1
| | | | | | ogClient changed /software from POST to GET. Adapt ogServer to work with ogClient /software new method.
* #915 Add POST /mode testDiego Crespo Quinta2020-12-021-0/+30
|
* #915 Fix POST /setup testDiego Crespo Quinta2020-12-021-0/+1
| | | | Add new type field to json.
* #915 Test GET /scopesDiego Crespo Quinta2020-12-012-0/+30
| | | | And fix ogserver, report error if GET /scopes have a JSON body.
* #1008 Add support to work with GPT tablesJavier Sánchez Parra2020-11-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | ogServer /setup do not support to indicate which table type the user want to use. It always supposes that the partition table is MBR/MSDOS. Add ogServer support to work with GPT tables. Add new field table type to /setup that expects a string with "MSDOS" or "GPT". Example old JSON: { "clients": [...], "disk": "1", "cache": "0", "cache_size": "0", "partition_setup": [...] } Example new JSON: { "clients": [...], "type": "GPT", "disk": "1", "cache": "0", "cache_size": "0", "partition_setup": [...] }
* #1008 Restore support for 4 disks and 16 partitionsJavier Sánchez Parra2020-11-182-15/+18
| | | | | | | | ogServer expects to receive information of 1 disk and 4 partitions from ogClient. Previous ogServer versions support several disks and partitions. Add ogServer support for 4 disks and 16 partitions.
* #915 add GET /session testDiego Crespo Quinta2020-11-172-4/+25
|
* #915 test malformed body in GET /client/setupIsabel Arrans2020-11-101-0/+25
|
* #915 fix POST /hardware testIsabel Arrans2020-10-271-1/+1
|
* #941 Fix get computer center idJavier Sánchez Parra2020-10-271-0/+1
| | | | | | | | | Creating a software profile failed. ogServer obtained the information of a computer without center id because commit cbd9421 removed it unintentionally, making all computer had center id equal to zero. This commit restores the gathering of computer center id from the database.
* #915 restore more testsIsabel Arrans2020-10-245-51/+4
|
* #915 remove old REST API from run-test.shOpenGnSys Support Team2020-10-231-4/+0
|
* #915 Fix expected returned codes in GET /session and GET /software testsDiego Crespo Quinta2020-10-222-2/+2
| | | | Fix incorrect status code.
* #915 Fix several test errorsDiego Crespo Quinta2020-10-229-156/+4
| | | | | | | | | | Test 0006: add json to GET /session and update expected return code. Test 0012: add json to GET /software and update expected return code (200), in this case json fields are integer, not string. Test 0020: remove it, /image/create/incremental does not exist anymore. Test 0021: same as before for /image/restore/basic Test 0022: same as before for /image/restore/incremental Test 0023: rename to test_0020.
* #942 Add GET /session REST API functionRoberto Hueso Gómez2020-10-201-2/+99
| | | | | | | | | | | | | | | | | | | | | | | This function returns the installed and available OSs in a client to be booted from. Request: GET /session { "client": ["192.168.56.11"] } Response 200 OK { "sessions": [ { "disk": 1, "name": "Ubuntu 18.04.4 LTS", "partition": 1 } ] }
* #942 Use client's IP as filter in GET /hardwareRoberto Hueso Gómez2020-10-201-17/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch uses client's IP instead of scope ID as a filter for the request. Request: GET /hardware { "client": ["192.168.56.11"] } Response: 200 OK { "hardware": [ { "description": "BIOS", "type": "Tipo de proceso de arranque" }, { "description": "QEMU Standard PC (i440FX + PIIX, 1996) v.pc-i440fx-5.1", "type": "Marca y modelo del equipo" }, { "description": "Intel Corp. Intel Core Processor (Haswell, no TSX, IBRS) 2GHz v.pc-i440fx-5.1", "type": "Microprocesadores" }, { "description": "QEMU 2049MiB (DIMM 0)", "type": "Memorias" }, { "description": "Red Hat, Inc. Virtio network device v.00", "type": "Tarjetas de Red" } ] }
* #942 Add GET /software REST API functionRoberto Hueso Gómez2020-10-161-2/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function retrieves a list of the software installed in a specific disk and partition of a client. This list can be updated by using POST /software beforehand. Request: GET /software { "client": ["192.168.56.11"], "disk": 1, "partition": 1 } Response: 200 OK { "software": [ "grub-pc-bin 2", "grub-pc 2.02", "grub2-common 2.02", "groff-base 1.22.3", "gpg 2.2.4", "gnupg-utils 2.2.4", "gnupg-l10n 2.2.4", "gnupg 2.2.4", "gnome-video-effects 0.4.3", "gnome-user-guide 3.28.2+git20180715", "gnome-user-docs 3.28.2+git20180715", "gnome-todo-common 3.28.1", "gnome-mines 3.28.0", "gnome-menus 3.13.3", "gnome-mahjongg 3.22.0", "gnome-keyring-pkcs11 3.28.0.2", "gnome-keyring 3.28.0.2", "gnome-initial-setup 3.28.0", "accountsservice 0.6.45" ] }
* #942 Extend GET /images functionRoberto Hueso Gómez2020-10-142-7/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This extension removes replaces the field 'filename' for 'name' and adds new fields (software_id, type and id). These new fields are useful when restoring an image. Request: GET /images Response: 200 OK { "disk": { "free": 37091418112, "total": 52573995008 }, "images": [ { "datasize": 5939200000, "id": 25, "modified": "Wed Oct 14 11:49:00 2020", "name": "archlinux", "permissions": "744", "size": 1844222333, "software_id": 19, "type": 1 } ] }
* #942 Create DB image when calling POST /image/createRoberto Hueso Gómez2020-10-143-6/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | In case the DB entry for an image does not exist when POST /image/create is called, this patch takes care of calling it. This adds few optional json parameters to the POST /image/create API. If optional parameters are included then this patch creates the DB entry, otherwise it just creates the actual image and updates the existing entry. Request: POST /image/create { "clients":["192.168.56.11"], "disk":"1", "partition":"1", "name":"archlinux", "repository":"192.168.56.10", "id":"24", "code":"131", "description":"This is a test", "group_id":0, "center_id":1 } Response: 200 OK
* Add REST POST /client/delete methodRoberto Hueso Gómez2020-10-081-0/+61
| | | | | | | | | | | | | | | This method deletes a client from the DB. Request: POST /client/delete { "clients": ["192.168.56.30"] } Response: 200 OK Co-authored-by: Javier Sánchez Parra <jsanchez@soleta.eu>
* #915 Use string for tests config portRoberto Hueso Gómez2020-10-071-1/+1
| | | | | This adapts the test configuration to the changes made in the commit fe1ce97c50e575201fe47d7587251e228edf8fdf
* #915 Update run-tests.py to the latest changesRoberto Hueso Gómez2020-10-072-3/+23
| | | | | | This handles changes in: - The host of the DB. - New json config file.
* #915 Add default SQL schema for testsRoberto Hueso Gómez2020-10-072-1/+1172
| | | | | This schema is now adapted to work on this repository instead of the "OpenGnsys" general repository.
* #971 remove unused contieneIP function in ogAdmLibOpenGnSys Support Team2020-10-071-31/+0
|
* #988 remove legacy configurationOpenGnSys Support Team2020-10-0712-98/+38
| | | | | Use og_server_cfg everywhere. Convert port to string to make it easy for the dbi API since it expects a string. Remove legacy example configuration file.
* #988 rename og_server_cfg to cfgOpenGnSys Support Team2020-10-073-7/+7
| | | | to avoid clash with existing variable cfg in client.c
* #988 Update ogserver.service to use json config fileRoberto Hueso Gómez2020-10-061-1/+1
| | | | This is convenient for the ogServer to use the new config file.
* #941 Use fixed length strings in og_computer and og_dbi_get_computer_infoRoberto Hueso Gómez2020-10-064-71/+63
| | | | | | This patch is a refactor for og_computer and og_dbi_get_computer_info. It now uses fixed lenght strings to make it more reliable and avoid errors if the DB is not returning a null ended string.
* #941 Add og_json_parse_string_copy(...) functionRoberto Hueso Gómez2020-10-062-0/+16
| | | | | This function provides an easy way to copy the content of a json string into a regular C string.
* #1004 set default path to repositoryOpenGnSys Support Team2020-10-062-3/+7
| | | | This is /opt/opengnsys/images if not specified.
* #988 remove legacy configuration fileOpenGnSys Support Team2020-10-055-207/+35
| | | | Add getopt parser and use json configuration file instead.
* #1004 Fix integer overflow in datasizeJavier Sánchez Parra2020-09-291-1/+1
| | | | ogClient datasize is now in bytes, update format to fix a possible overflow.
* #1004 Add GET /imagesJavier Sánchez Parra2020-09-294-1/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds GET /images to the ogServer REST API. This call returns information of all the images in ogServer. Example response: { "images": [ { "filename": "ubuntu.img", "datasize": 2150400000, "size": 613476223, "modified": "Wed Sep 23 10:37:36 2020", "permissions": "744" }, { "filename": "test.img", "datasize": 2150400000, "size": 613236475, "modified": "Tue Sep 29 08:57:47 2020", "permissions": "744" } ], "disk": { "total": 52573995008, "free": 39624544256 } }
* #988 Add global config variableJavier Sánchez Parra2020-09-292-1/+4
| | | | | | This commit makes configuration variable global. To use this variable you have to #import "cfg.h".
* #942 Add POST /client/add HTTP REST methodRoberto Hueso Gómez2020-09-241-0/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This method adds a new client. This new client's IP cannot be duplicated in the DB. Request: POST /client/add { "boot": "19pxeADMIN", "center": 0, "hardware_id": 0, "id": 2, "ip": "192.168.56.12", "livedir": "ogLive", "mac": "0800270E6512", "maintenance": true, "name": "pc12", "netdriver": "generic", "netiface": "eth1", "netmask": "255.255.255.0", "remote": false, "repo_id": 1, "room": 1, "serial_number": "" } Response: 200 OK
* #988 use-after-free in json configuration parserOpenGnSys Support Team2020-09-222-10/+20
| | | | | The cfg structure stores pointers to the string in this json tree. Do not release the json tree, keep it as field in the cfg structure.
* #1004 Add GET /client/info HTTP REST methodRoberto Hueso Gómez2020-09-221-0/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This method provides information about a specific client. The request must contain exactly 1 client's IP. Request: GET /client/info {"client": ["192.168.56.12"]} Response: 200 OK { "boot": "19pxeADMIN", "center": 0, "hardware_id": 0, "id": 2, "ip": "192.168.56.12", "livedir": "ogLive", "mac": "0800280E6871", "maintenance": true, "name": "pc12", "netdriver": "generic", "netiface": "eth1", "netmask": "255.255.255.0", "remote": false, "repo_id": 1, "room": 1, "serial_number": "" }
* #941 Extend og_dbi_get_computer_info(...)Roberto Hueso Gómez2020-09-223-16/+80
| | | | | | For the strings in og_computer we do not need to know the max size in advance but instead we need to free up memmory using og_dbi_free_computer_info(...) function.
* #941 pass og_dbi to og_dbi_get_computer_info()OpenGnSys Support Team2020-09-183-52/+55
| | | | Reuse the existing dbi handler, instead of opening a new one.
* #941 move og_dbi_get_computer_info() to dbiOpenGnSys Support Team2020-09-183-59/+65
| | | | Move this function to the dbi.{h,c} files.
* #988 fix compilation warning in json configuration file to legacyOpenGnSys Support Team2020-09-151-8/+8
| | | | | src/cfg.c: In function ‘from_json_to_legacy’: src/cfg.c:161:2: warning: format not a string literal and no format arguments [-Wformat-security]
* Fix size of og_cmd_get_client_setup() return arrayRoberto Hueso Gómez2020-09-151-1/+2
| | | | The return array needs to store 1 extra element for the disk setup.
* #1004 Add GET /client/setup HTTP REST methodRoberto Hueso Gómez2020-09-141-0/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | This method provides the partitions setup for a specific client. The request must contain exactly 1 client's IP. Request: GET /client/setup {'client': ['192.168.56.12']} Response: 200 OK { "partitions": [ { "disk": 1, "partition": 0, "code": 0, "size": 20971520, "used_size": 0, "filesystem": 0, "os": 0, "image": 0, "software": 0 } ] }
* #971 replace reservaMemoria() by calloc()OpenGnSys Support Team2020-09-102-21/+1
| | | | reservaMemoria() is only used once, remove it.
* #971 remove unused functions in ogAdmLibOpenGnSys Support Team2020-09-102-127/+0
| | | | Remove unused legacy code.
* #1004 Handle new fields in /image/create responseJavier Sánchez Parra2020-09-103-3/+58
| | | | | | | | | | | | | | | | | | | | | | | | ogClient now includes more information regarding the new image. This patch modifies ogServer to support new elements sent in ogClient /image/create response and store them in the database. Example of new /image/create response: { "disk": "1", "partition": "1", "code": "131", "id": "1", "name": "ubuntu", "repository": "192.168.56.10", "software": "Ubuntu 18.04.5 LTS \naccountsservice 0.6.45\n...", "clonator": "PARTCLONE", "compressor": "LZOP", "filesystem": "EXTFS", "datasize": 2100000 } New fields are "clonator", "compressor", "filesystem" and "datasize".
* #980 do not report busy client if probing is pendingOpenGnSys Support Team2020-08-211-1/+6
| | | | og_client_status() should not report busy when probing is going on.
* #980 Add 'ip' field in GET /scopes requestRoberto Hueso Gómez2020-08-141-4/+4
| | | | | The 'ip' field is added to the json for scopes that have an IP (i.e. computers).
* #980 Select POST /mode clients by ip instead of scope nameRoberto Hueso Gómez2020-08-141-14/+18
| | | | | | This patch selects clients whose modes need to be changed in the current request. This patch makes POST /mode consistent with the rest of the REST API where clients are selected and filtered by ip.
* #998 disable incremental image APIOpenGnSys Support Team2020-08-146-566/+0
| | | | This API is not supported by ogClient yet and it uses the obsolete socket hydra API.