{
struct json_object *resp;
INFO("method runnables called");
- resp = afm_udb_applications_public(afudb);
+ resp = afm_udb_applications_public(afudb, afb_req_get_uid(req));
afb_req_success(req, resp, NULL);
}
/* wants details for appid */
INFO("method detail called for %s", appid);
- resp = afm_udb_get_application_public(afudb, appid);
+ resp = afm_udb_get_application_public(afudb, appid, afb_req_get_uid(req));
if (resp)
afb_req_success(req, resp, NULL);
else
/* get the application */
INFO("method start called for %s", appid);
- appli = afm_udb_get_application_private(afudb, appid);
+ appli = afm_udb_get_application_private(afudb, appid, afb_req_get_uid(req));
if (appli == NULL) {
not_found(req);
return;
}
/* launch the application */
- runid = afm_urun_start(appli);
+ runid = afm_urun_start(appli, afb_req_get_uid(req));
if (runid <= 0) {
cant_start(req);
return;
/* get the application */
INFO("method once called for %s", appid);
- appli = afm_udb_get_application_private(afudb, appid);
+ appli = afm_udb_get_application_private(afudb, appid, afb_req_get_uid(req));
if (appli == NULL) {
not_found(req);
return;
}
/* launch the application */
- runid = afm_urun_once(appli);
+ runid = afm_urun_once(appli, afb_req_get_uid(req));
if (runid <= 0) {
cant_start(req);
return;
}
/* returns the state */
- resp = afm_urun_state(afudb, runid);
+ resp = afm_urun_state(afudb, runid, afb_req_get_uid(req));
afb_req_success(req, resp, NULL);
}
{
int runid, status;
if (onrunid(req, "pause", &runid)) {
- status = afm_urun_pause(runid);
+ status = afm_urun_pause(runid, afb_req_get_uid(req));
reply_status(req, status, _not_found_);
}
}
{
int runid, status;
if (onrunid(req, "resume", &runid)) {
- status = afm_urun_resume(runid);
+ status = afm_urun_resume(runid, afb_req_get_uid(req));
reply_status(req, status, _not_found_);
}
}
{
int runid, status;
if (onrunid(req, "terminate", &runid)) {
- status = afm_urun_terminate(runid);
+ status = afm_urun_terminate(runid, afb_req_get_uid(req));
reply_status(req, status, _not_found_);
}
}
{
struct json_object *resp;
INFO("method runners called");
- resp = afm_urun_list(afudb);
+ resp = afm_urun_list(afudb, afb_req_get_uid(req));
afb_req_success(req, resp, NULL);
}
int runid;
struct json_object *resp;
if (onrunid(req, "state", &runid)) {
- resp = afm_urun_state(afudb, runid);
+ resp = afm_urun_state(afudb, runid, afb_req_get_uid(req));
reply(req, resp, _not_found_);
}
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
static void install(struct afb_req req)
{
const char *wgtfile;
json = afb_req_json(req);
if (wrap_json_unpack(json, "s", &wgtfile)
|| wrap_json_unpack(json, "{ss s?s s?b s?b}",
- "widget", &wgtfile,
+ "wgt", &wgtfile,
"root", &root,
"force", &force,
"reload", &reload)) {
static int init()
{
/* init database */
- afudb = afm_udb_create(1, 1, "afm-appli-");
+ afudb = afm_udb_create(1, 0, "afm-appli-");
if (!afudb) {
ERROR("afm_udb_create failed");
return -1;