| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
do not use description field to decide if this is a new image or an update.
add og_dbi_get_image() to check if the image exists. If it is not found, then
add new image entry to database.
update og_dbi_add_image() to update the image.id field.
|
|
|
|
|
|
|
|
|
|
|
| |
netmask field in 'computers' table is never used, but ogcli still
displays it through:
# ogcli list client --client-ip 1.2.3.4
and it shows '0' or incorrect netmask (ogCP hardcodes this field).
Update SQL query to fetch the room.netmask instead.
|
|
|
|
|
|
|
| |
Add GET /room/info to obtain room information, this includes the name,
gateway and netmask.
curl -X GET -H "Authorization: $API_KEY" http://127.0.0.1:8888/room/info -d '{ "id" : 1 }
|
|
|
|
|
|
|
|
|
| |
Extend og_dbi_get_computer_info to fetch "identorno" column from
"ordenadores". "identorno" holds the row id value from the "entornos"
table (valid ogserver addresses).
Extend og_computer struct with a new field: "server_id" that will store
the value of "identorno" column fetched from the database.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
POST /image/create has two modes, image creation and update. You can
find more information about the "creation" mode in commit:
d2f20d0be06617f421eecca111449d94672695eb
On image creation, use the id to identify repositories instead of the
IP. This is a preparative commit to the support of repositories with
several IPs.
On image update, "repository_id" field is not needed because the image
already has the repository assigned.
This commit maintains backward compatibility with the Web Console (old
web interface), because it only use the "update" mode of /image/create.
Request POST /create/image:
{
"clients": [
"192.168.56.11"
],
"disk": "1",
"partition": "1",
"name": "archlinux",
"repository_id": 1,
"id": "0",
"code": "131",
"description": "This is a test",
"group_id": 0,
"center_id": 1
}
Response 200 OK
|
|
|
|
|
| |
Assign to the image the repository indicated in the JSON body instead of
a default one.
|
|
|
|
|
|
|
|
|
|
| |
When trying to open a connection to a database, an instance of
libdbi is created before any connection attempt. If connection is
unsuccessful then the og_dbi struct is freed but not the
libdbi instance member, thus leaking its memory.
Use libdbi dbi_shutdown_r to shutdown libdbi instance member
before freeing og_dbi struct inside og_dbi_open.
|
|
|
|
| |
Update license header in files.
|
|
|
|
|
|
|
|
|
|
| |
/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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Reuse the existing dbi handler, instead of opening a new one.
|
|
|
|
| |
Move this function to the dbi.{h,c} files.
|
|
|
|
|
| |
This patch provides functionality to select a database port. It also adds a
default IP for the database.
|
|
Use the same folder as in ogClient.
|