summaryrefslogtreecommitdiffstats
path: root/src/dbi.h
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2024-06-12 11:37:36 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2024-06-12 11:38:08 +0200
commit9891276246b96ca1bc43383b3e434a7d8f0ed91f (patch)
tree8033d0ba7cded6fde5f8474ebd09aebc90bd2ca7 /src/dbi.h
parent51f275a867b4a7007ea6e2aa93f350f08be2680e (diff)
rest: Add /center/info
Add URI to allow a GET request to obtain info about a center (name, id and comment of the center as of now). To use this uri, simply send a GET request with a json containing the id of the center whose info needs to be consulted: curl -X GET -H "Authorization: $API_KEY" http://127.0.0.1:8888/center/info -d '{"id":1}' based on work from Javier Hernandez.
Diffstat (limited to 'src/dbi.h')
-rw-r--r--src/dbi.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/dbi.h b/src/dbi.h
index 7286fe3..d6de474 100644
--- a/src/dbi.h
+++ b/src/dbi.h
@@ -41,6 +41,7 @@ void og_dbi_close(struct og_dbi *db);
#define OG_DB_MAC_MAXLEN 15
#define OG_DB_IP_MAXLEN 15
#define OG_DB_SMALLINT_MAXLEN 6
+#define OG_DB_COMMENT_MAXLEN 250
struct og_image_legacy {
char software_id[OG_DB_INT_MAXLEN + 1];
@@ -110,6 +111,12 @@ struct og_room {
bool remote;
};
+struct og_center {
+ uint32_t id;
+ char name[OG_DB_CENTER_NAME_MAXLEN + 1];
+ char comment[OG_DB_COMMENT_MAXLEN + 1];
+};
+
struct og_folder {
unsigned int id;
unsigned int room;
@@ -128,6 +135,7 @@ int og_dbi_get_computer_info(struct og_dbi *dbi, struct og_computer *computer,
struct in_addr addr);
int og_dbi_get_room_info(struct og_dbi *dbi, struct og_room *room,
uint32_t room_id);
+int og_dbi_get_center_info(struct og_dbi *dbi, struct og_center *center);
bool og_dbi_get_image(struct og_dbi *dbi, struct og_image *image);
int og_dbi_add_image(struct og_dbi *dbi, struct og_image *image);