summaryrefslogtreecommitdiffstats
path: root/server/api/backends.js
diff options
context:
space:
mode:
authorJannik Schönartz2019-04-08 01:42:35 +0200
committerJannik Schönartz2019-04-08 01:42:35 +0200
commita3e2cb36b0cbceb025753c7aeae0553de043b968 (patch)
tree71936590fcff8c4fc5d75e0842ad05faed856b27 /server/api/backends.js
parent[eventmanager] fix blacklist not deselecting correctly (diff)
downloadbas-a3e2cb36b0cbceb025753c7aeae0553de043b968.tar.gz
bas-a3e2cb36b0cbceb025753c7aeae0553de043b968.tar.xz
bas-a3e2cb36b0cbceb025753c7aeae0553de043b968.zip
[server/backends] Add infoblox ipxe ip selection stuff
Diffstat (limited to 'server/api/backends.js')
-rw-r--r--server/api/backends.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/server/api/backends.js b/server/api/backends.js
index 838467a..e92999a 100644
--- a/server/api/backends.js
+++ b/server/api/backends.js
@@ -9,6 +9,16 @@ var noAuthRouter = decorateApp(express.Router())
// GET requests.
+// TODO DELETE
+noAuthRouter.getAsync('/:id/test', async (req, res) => {
+ const id = req.params.id
+ const backend = await db.backend.findOne({ where: { id: id } })
+ const externalBackends = new ExternalBackends()
+ const instance = externalBackends.getInstance(backend.type)
+ const result = await instance.test(backend.credentials)
+ res.send(result)
+})
+
/*
* @return: Returns a list of all backends saved in the db.
*/
@@ -31,7 +41,7 @@ router.getAsync('/:id', async (req, res) => {
const instance = externalBackends.getInstance(backend.type)
let credentialTypes = instance.getCredentials()
- // Get the ids of the 'password' fieldds
+ // Get the ids of the 'password' fields
let censorIds = []
credentialTypes.forEach(function f (element) {
if (element.type === 'switch') {