summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2023-12-12 10:22:48 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2023-12-12 10:23:46 +0100
commit721ab28fdfe261d50803a2a240adaa8afccff471 (patch)
tree2d71d95dd2e5122cd66b69c0fc2d65d772057ea6
parent16d7a18441ef8f3073b362a8b98cd4d6cc02e4d2 (diff)
rest: expose description in GET /images
add .description field to json.
-rw-r--r--src/rest.c7
1 files changed, 6 insertions, 1 deletions
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);