- if (json_object_object_get_ex(o, _apis_, &v)) {
- x = json_object_new_object();
- json_object_object_add(r, _apis_, x);
- get_apis(x, v);
+/******************************************************************************
+**** Implementation monitoring verbs
+******************************************************************************/
+
+static void f_get(afb_req_t req)
+{
+ struct json_object *r;
+ struct json_object *apis = NULL;
+ struct json_object *verbosity = NULL;
+
+ wrap_json_unpack(afb_req_json(req), "{s?:o,s?:o}", _verbosity_, &verbosity, _apis_, &apis);
+ if (!verbosity && !apis)
+ afb_req_success(req, NULL, NULL);
+ else {
+ r = json_object_new_object();
+ if (!r)
+ afb_req_fail(req, "out-of-memory", NULL);
+ else {
+ if (verbosity) {
+ verbosity = get_verbosity(verbosity);
+ json_object_object_add(r, _verbosity_, verbosity);
+ }
+ if (!apis)
+ afb_req_success(req, r, NULL);
+ else
+ describe_apis(req, r, apis);
+ }