mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
api: refactor "command" => "action"
This commit is contained in:
parent
22eefc7590
commit
84aff14eed
3 changed files with 5 additions and 5 deletions
|
@ -71,7 +71,7 @@ int api_session_init(struct api_session *s, enum api_mode m);
|
|||
|
||||
int api_session_destroy(struct api_session *s);
|
||||
|
||||
int api_session_run_command(struct api_session *s, json_t *req, json_t **resp);
|
||||
int api_session_run_action(struct api_session *s, json_t *req, json_t **resp);
|
||||
|
||||
char * api_session_name(struct api_session *s);
|
||||
|
||||
|
|
|
@ -367,7 +367,7 @@ static void * api_worker(void *ctx)
|
|||
|
||||
queue_pull(&s->request.queue, (void **) &req);
|
||||
|
||||
api_session_run_command(s, req, &resp);
|
||||
api_session_run_action(s, req, &resp);
|
||||
|
||||
json_decref(req);
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ int api_session_destroy(struct api_session *s)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int api_session_run_command(struct api_session *s, json_t *json_in, json_t **json_out)
|
||||
int api_session_run_action(struct api_session *s, json_t *json_in, json_t **json_out)
|
||||
{
|
||||
int ret;
|
||||
const char *action;
|
||||
|
@ -110,7 +110,7 @@ int api_session_run_command(struct api_session *s, json_t *json_in, json_t **jso
|
|||
"action", action,
|
||||
"id", id,
|
||||
"code", ret,
|
||||
"error", "command not found");
|
||||
"error", "action not found");
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -122,7 +122,7 @@ int api_session_run_command(struct api_session *s, json_t *json_in, json_t **jso
|
|||
"action", action,
|
||||
"id", id,
|
||||
"code", ret,
|
||||
"error", "command failed");
|
||||
"error", "action failed");
|
||||
else
|
||||
*json_out = json_pack("{ s: s, s: s }",
|
||||
"action", action,
|
||||
|
|
Loading…
Add table
Reference in a new issue