distroy
This commit is contained in:
parent
df52918142
commit
152e75c79d
6
lxc.js
6
lxc.js
@ -49,8 +49,8 @@ module.exports = function(config){
|
||||
sysExec('lxc-clone -o '+base_name+ ' -n '+name +' -B overlayfs -s', cbComplete, cbData);
|
||||
};
|
||||
|
||||
obj.destroy = function(name, cbComplete, cbData){
|
||||
sysExec('lxc-destroy -n '+ name, cbComplete, cbData);
|
||||
obj.destroy = function(name, callback){
|
||||
sysExec('lxc-destroy -n '+ name, callback);
|
||||
};
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@ module.exports = function(config){
|
||||
sysExec(cmd, cbComplete, cbData);
|
||||
};
|
||||
|
||||
obj.startEphemeral = function(name, base_name, cbComplete, cbData){
|
||||
obj.startEphemeral = function(name, base_name, cbData){
|
||||
|
||||
var output = '';
|
||||
sysExec('lxc-start-ephemeral -o '+base_name+ ' -n '+name +' --union-type overlayfs -d', function(data){output+=data}, function(error){
|
||||
|
@ -30,7 +30,7 @@ router.get('/start/:name', function(req, res, next){
|
||||
});
|
||||
|
||||
router.get('/live/:template/:name', function(req, res, next){
|
||||
lxc.startEphemeral(req.params.name, req.params.template, null, function (data) {
|
||||
lxc.startEphemeral(req.params.name, req.params.template, function (data) {
|
||||
res.json(data);
|
||||
});
|
||||
});
|
||||
@ -56,7 +56,7 @@ router.get('/clone/:template/:name', function(req, res, next){
|
||||
});
|
||||
|
||||
router.get('/destroy/:name', function(req, res, next){
|
||||
lxc.destroy(req.params.name, null, function(data, message){
|
||||
lxc.destroy(req.params.name, function(data, message){
|
||||
if(data){
|
||||
res.json({status: 500, message: message});
|
||||
}else{
|
||||
|
Loading…
x
Reference in New Issue
Block a user