diff --git a/lib/api/actions/node.cpp b/lib/api/actions/node.cpp index 006c7ba42..56a15ffef 100644 --- a/lib/api/actions/node.cpp +++ b/lib/api/actions/node.cpp @@ -24,10 +24,11 @@ #include #include -#include +#include #include #include - +#include +#include #include namespace villas { @@ -37,10 +38,9 @@ namespace api { template class NodeAction : public Action { -proctected: - int action(struct node *n) = 0; - public: + using Action::Action; + virtual int execute(json_t *args, json_t **resp) { int ret; @@ -53,13 +53,13 @@ public: if (ret) return ret; - struct list *nodes = &s->api->super_node->nodes; - struct node *node = list_lookup(nodes, node_str); + struct list *nodes = session->getSuperNode()->getNodes(); + struct node *n = (struct node *) list_lookup(nodes, node_str); - if (!node) + if (!n) return -1; - return A(node); + return A(n); } };