summaryrefslogtreecommitdiffstats
path: root/src/dbi.c
Commit message (Collapse)AuthorAgeFilesLines
* ogServer is AGPLv3+OpenGnSys Support Team2021-05-041-2/+3
| | | | Update license header in files.
* #915 Avoid duplicate db entries in /create/imagev1.2.0Jose M. Guisado2021-04-061-0/+18
| | | | | | | | | | /create/image adds an entry to the database for the given partition image created when payload contains a "description" attribute. This insertion into the database is lacking a check for duplicates, which are not supported for the images table. Add a prior duplicate check before inserting. Exit with -1 code if an image with the same name is found.
* #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.
* #942 Create DB image when calling POST /image/createRoberto Hueso Gómez2020-10-141-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-3/+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-22/+19
| | | | | | 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-8/+45
| | | | | | 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-11/+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/+54
| | | | 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/+45
Use the same folder as in ogClient.