diff --git a/feeds/tip/cloud_discovery/files/usr/bin/cloud_discovery b/feeds/tip/cloud_discovery/files/usr/bin/cloud_discovery index 1fb0456a7..e05c13ec2 100755 --- a/feeds/tip/cloud_discovery/files/usr/bin/cloud_discovery +++ b/feeds/tip/cloud_discovery/files/usr/bin/cloud_discovery @@ -287,6 +287,25 @@ let ubus_methods = { } }, + status: { + call: function(req) { + const names = [ 'discover', 'validate', 'online', 'offline', 'orphan' ]; + let ret = { state: names[state] }; + switch(state){ + case OFFLINE: + ret.since = time() - offline_time; + break; + case ORPHAN: + ret.since = time() - orphan_time; + break; + case VALIDATING: + ret.since = time() - validate_time;; + break; + } + return ret; + }, + args: {}, + }, }; if (gateway_available()) {