summaryrefslogtreecommitdiffstats
path: root/src/dbi.h
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2022-06-16 14:28:43 +0200
committerJavier Sánchez Parra <jsanchez@soleta.eu>2022-06-20 10:41:32 +0200
commit52a38d3e574fb25b47d230bc87754583eb17b4a6 (patch)
tree0cca8d4a0ef608459addd256b6740b0de044d2d6 /src/dbi.h
parenta0a3470682852d5f72967553d5debe41e86eca78 (diff)
#915 Use the repository id on image creation
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
Diffstat (limited to 'src/dbi.h')
-rw-r--r--src/dbi.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dbi.h b/src/dbi.h
index 2423503..bebae02 100644
--- a/src/dbi.h
+++ b/src/dbi.h
@@ -58,6 +58,7 @@ struct og_image {
uint64_t center_id;
uint64_t datasize;
uint64_t group_id;
+ uint64_t repo_id;
uint64_t type;
uint64_t id;
struct stat image_stats;
@@ -110,4 +111,7 @@ int og_dbi_add_image(struct og_dbi *dbi, const struct og_image *image);
int og_dbi_schema_update(void);
+int og_dbi_get_repository_ip(const struct og_dbi *dbi, const uint64_t image_id,
+ char *repository_ip);
+
#endif