summaryrefslogtreecommitdiffstats
path: root/src/dbi.h
Commit message (Collapse)AuthorAgeFilesLines
* #1054 Fix og_legacy_partition code buffer sizeJose M. Guisado2021-07-261-1/+2
| | | | | | | | | | | The "code" member of the og_legacy_partition is used to hold the string of the partition type *name* for legacy parameter strings. Example: par=2*cpt=LINUX-SWAP*sfi=LINUX-SWAP*tam=10000000*ope=0 Problem: Buffer size is smaller than possible values for this member. Fix: Increase buffer size up to the max length defined in the DB for the corresponding column.
* #915 Add /room/add POST methodJavier Sánchez Parra2021-04-201-0/+13
| | | | | | | | | | | | | | | | | | | | | | | Adds POST method to add rooms (labs), required payload parameters are name, netmask and center; any additional attributes are optional. Required JSON: { "center": 0, "name": "classroom10", "netmask": "255.255.255.0" } Full JSON: { "center": 0, "name": "classroom11", "netmask": "255.255.255.0", "group": 0, "location": "First floor", "gateway": "192.168.56.1", "ntp": "hora.cica.es", "dns": "1.1.1.1", "remote": True } This commit also adds unit tests for /room/add POST method.
* #1042 Update database schema automaticallyJose M. Guisado2021-04-201-0/+2
| | | | | | | | | | | | | | | This patch adds database schema management capabilities to ogServer: - ogServer now tracks the version of its database schema, if no version is detected, creates a 'version' table with a single row starting at 0. - ogServer can upgrade its database schema to a newer version if detected. (ogServer ships required SQL commands to do so) If ogServer is unable to upgrade the schema at startup (if needed be) it *will not* start. Defines schema update v1 which upgrades database engine tables of ogServer database (usually named 'ogAdmBD') from myISAM to innoDB.
* #942 Extend GET /images functionRoberto Hueso Gómez2020-10-141-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-141-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* #988 remove legacy configurationOpenGnSys Support Team2020-10-071-5/+3
| | | | | 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.
* #941 Use fixed length strings in og_computer and og_dbi_get_computer_infoRoberto Hueso Gómez2020-10-061-10/+15
| | | | | | 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 Extend og_dbi_get_computer_info(...)Roberto Hueso Gómez2020-09-221-3/+17
| | | | | | 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-181-1/+2
| | | | Reuse the existing dbi handler, instead of opening a new one.
* #941 move og_dbi_get_computer_info() to dbiOpenGnSys Support Team2020-09-181-0/+11
| | | | Move this function to the dbi.{h,c} files.
* #988 Add DB port option to ogserver.json config fileRoberto Hueso Gómez2020-07-101-0/+1
| | | | | This patch provides functionality to select a database port. It also adds a default IP for the database.
* #971 rename sources folder to srcOpenGnSys Support Team2020-06-261-0/+51
Use the same folder as in ogClient.