summaryrefslogtreecommitdiffstats
path: root/src/json.h
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2020-07-06 17:26:40 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2020-07-06 17:27:33 +0200
commit33b0c6f694c3365e6280b01d9253aefa892075e9 (patch)
tree2a5be232ba5edc587423f97b5265d86e065c4781 /src/json.h
parent96b02b5424db61c32386c48fe05ec3375d8a84f5 (diff)
Add POST /modes REST request
This patch implements HTTP POST /modes request which can change the mode of any particular scope. Request: POST /modes { "scope": {"id": 1, "type": "computer"}, "mode": "pxe" } Response: 200 OK
Diffstat (limited to 'src/json.h')
-rw-r--r--src/json.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/json.h b/src/json.h
index ccc5097..580eb4f 100644
--- a/src/json.h
+++ b/src/json.h
@@ -50,6 +50,17 @@ struct og_sync_params {
const char *method;
};
+#define OG_PARAM_SCOPE_ID (1UL << 0)
+#define OG_PARAM_SCOPE_TYPE (1UL << 1)
+
+struct og_scope {
+ uint32_t id;
+ const char *type;
+};
+
+int og_json_parse_scope(json_t *element, struct og_scope *scope,
+ const uint64_t required_flags);
+
struct og_msg_params {
const char *ips_array[OG_CLIENTS_MAX];
const char *mac_array[OG_CLIENTS_MAX];