only one snowflake onelabs
This commit is contained in:
@@ -227,6 +227,22 @@ router.post('/:userId/provisions', passport.ensureAuthenticatedAndIsMe, async (r
|
||||
}
|
||||
}
|
||||
|
||||
if ( scenarioSource.name.includes('onelabs-snowflake') && req.body.options && req.body.options.user_name && req.body.options.user_name.selected){
|
||||
const thingName = req.body.options.user_name.selected;
|
||||
const onelabProv = await db.provision.getOne({"user": userId, "scenario": scenarioSource.name, "description": thingName});
|
||||
if ( onelabProv ) {
|
||||
|
||||
queues[WEBHOOK_QUEUE].add("webhook_job", {
|
||||
provId: onelabProv._id,
|
||||
scenario: onelabProv.scenario,
|
||||
user: userId,
|
||||
eventType: 'provision.finished'
|
||||
});
|
||||
|
||||
return res.status(200).json(onelabProv);
|
||||
}
|
||||
}
|
||||
|
||||
//if (!req.body.options || !req.body.options.vm1 || !req.body.options.vm1.vmType ) {
|
||||
// return res.status(400).json({"msg": "Invalid options"});
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user