summaryrefslogtreecommitdiffstats
path: root/src/rest.h
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2024-10-31 00:27:57 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2024-10-31 01:18:57 +0100
commit479998d76f805c02e041adb209857d4ca6b3f87f (patch)
treea4f6fb7eaba79bea741f5784616fef19494c9d70 /src/rest.h
parent83b1be65897095cdc51b427ba3e42ae3d8756f32 (diff)
src: add last client command context and use it for image creation
Add last client command context that is used in the request to client. This allows to remove the stub image entry in the database in case that the image creation fails.
Diffstat (limited to 'src/rest.h')
-rw-r--r--src/rest.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/rest.h b/src/rest.h
index ff1486b..be5b17a 100644
--- a/src/rest.h
+++ b/src/rest.h
@@ -51,6 +51,14 @@ enum og_cmd_result {
OG_SUCCESS = 2,
};
+struct og_cmd_ctx {
+ union {
+ struct {
+ uint32_t id;
+ } image;
+ };
+};
+
#define OG_MSG_REQUEST_MAXLEN 131072
struct og_client {
@@ -70,6 +78,7 @@ struct og_client {
enum og_cmd_type type;
unsigned int id;
enum og_cmd_result result;
+ struct og_cmd_ctx ctx;
} last_cmd;
uint32_t speed;
uint32_t seq;
@@ -159,7 +168,7 @@ enum og_rest_method {
int og_send_request(enum og_rest_method method, enum og_cmd_type type,
const struct og_msg_params *params,
- const json_t *data);
+ const json_t *data, const struct og_cmd_ctx *ctx);
int og_dbi_scope_get(struct og_dbi *dbi, json_t *array);