浏览代码

Add ping/pong to API so controller supervisor in Central can do a full-path check of controller uptime, etc.

Adam Ierymenko 8 年之前
父节点
当前提交
e5284771e4
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      controller/EmbeddedNetworkController.cpp

+ 6 - 2
controller/EmbeddedNetworkController.cpp

@@ -1069,13 +1069,17 @@ unsigned int EmbeddedNetworkController::handleControlPlaneHttpPOST(
 
 
 		} // else 404
 		} // else 404
 
 
-	} else if (path[0] == "dbtest") {
+	} else if (path[0] == "ping") {
 
 
 		json testRec;
 		json testRec;
 		const uint64_t now = OSUtils::now();
 		const uint64_t now = OSUtils::now();
 		testRec["clock"] = now;
 		testRec["clock"] = now;
 		testRec["uptime"] = (now - _startTime);
 		testRec["uptime"] = (now - _startTime);
-		_db.put("dbtest",testRec);
+		testRec["content"] = b;
+		_db.put("pong",testRec);
+		responseBody = OSUtils::jsonDump(testRec);
+		responseContentType = "application/json";
+		return 200;
 
 
 	}
 	}