diff options
author | Javier Sánchez Parra <jsanchez@soleta.eu> | 2020-09-09 11:27:45 +0200 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2020-09-10 14:48:26 +0200 |
commit | 0efc182c9ba71cb7a8afeeaea6593c52c35cc4ae (patch) | |
tree | 537c11d1c712a9ef10714b72a1642ec12fb545f0 /src/json.c | |
parent | a1aaad46fb480fd7bd3204d7e7f5ade15eb4d031 (diff) |
#1004 Handle new fields in /image/create response
ogClient now includes more information regarding the new image. This patch
modifies ogServer to support new elements sent in ogClient /image/create
response and store them in the database.
Example of new /image/create response:
{
"disk": "1",
"partition": "1",
"code": "131",
"id": "1",
"name": "ubuntu",
"repository": "192.168.56.10",
"software": "Ubuntu 18.04.5 LTS \naccountsservice 0.6.45\n...",
"clonator": "PARTCLONE",
"compressor": "LZOP",
"filesystem": "EXTFS",
"datasize": 2100000
}
New fields are "clonator", "compressor", "filesystem" and "datasize".
Diffstat (limited to 'src/json.c')
-rw-r--r-- | src/json.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -18,6 +18,15 @@ int og_json_parse_string(json_t *element, const char **str) return 0; } +int og_json_parse_uint64(json_t *element, uint64_t *integer) +{ + if (json_typeof(element) != JSON_INTEGER) + return -1; + + *integer = json_integer_value(element); + return 0; +} + int og_json_parse_uint(json_t *element, uint32_t *integer) { if (json_typeof(element) != JSON_INTEGER) |