From 721ab28fdfe261d50803a2a240adaa8afccff471 Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Tue, 12 Dec 2023 10:22:48 +0100 Subject: rest: expose description in GET /images add .description field to json. --- src/rest.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/rest.c b/src/rest.c index bd28b67..84018fb 100644 --- a/src/rest.c +++ b/src/rest.c @@ -2499,6 +2499,8 @@ static json_t *og_json_image_alloc(struct og_image *image) json_integer(image->id)); json_object_set_new(image_json, "repo_id", json_integer(image->repo_id)); + json_object_set_new(image_json, "description", + json_string(image->description)); return image_json; } @@ -2538,7 +2540,8 @@ static int og_cmd_images(char *buffer_reply) " i.clonator, i.compressor, " " i.filesystem, i.datasize, " " i.idperfilsoft, i.tipo, " - " i.idimagen, i.idrepositorio " + " i.idimagen, i.idrepositorio, " + " i.descripcion " "FROM imagenes i " "LEFT JOIN ordenadores o " "ON i.idordenador = o.idordenador "); @@ -2552,6 +2555,8 @@ static int og_cmd_images(char *buffer_reply) image.repo_id = dbi_result_get_ulonglong(result, "idrepositorio"); snprintf(image.name, sizeof(image.name), "%s", dbi_result_get_string(result, "nombreca")); + snprintf(image.description, sizeof(image.description), "%s", + dbi_result_get_string(result, "descripcion")); og_get_image_stats(image.name, &image.image_stats); -- cgit v1.2.3-18-g5258