Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions server/app/model/blueprint/blueprint.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ BlueprintSchema.methods.launch = function(opts, callback) {
sessionUser: opts.sessionUser,
users: self.users,
blueprintData: self,
tagServer: opts.tagServer,
}, function(err, launchData) {
callback(err, launchData);
});
Expand All @@ -366,6 +367,7 @@ BlueprintSchema.methods.launch = function(opts, callback) {
sessionUser: opts.sessionUser,
users: self.users,
blueprintData: self,
tagServer: opts.tagServer,
}, function(err, launchData) {
callback(err, launchData);
});
Expand Down Expand Up @@ -989,7 +991,21 @@ BlueprintSchema.statics.getBlueprintsServiceDeliveryCheck = function(serviceDeli
callback(null, blueprints);
return;
});
};

BlueprintSchema.statics.removeServiceDeliveryBlueprints = function(blueprintId, callback) {
this.update({ "_id": new ObjectId(blueprintId)}, {serviceDeliveryCheck: false}, function (err, data) {
if (err) {
logger.error(err);
callback(err, null);
return;
}
if (data.length) {
callback(null, data[0]);
} else {
callback(null, null);
}
});
};

BlueprintSchema.statics.getBlueprintsByOrgBgProjectProvider = function(jsonData, callback) {
Expand Down
14 changes: 14 additions & 0 deletions server/app/model/classes/tasks/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,20 @@ taskSchema.statics.getTasksServiceDeliveryCheck = function(serviceDeliveryCheck,
});
};

taskSchema.statics.removeServiceDeliveryTask = function(taskId, callback) {
this.update({ "_id": new ObjectId(taskId)}, {serviceDeliveryCheck:false}, function (err, data) {
if (err) {
logger.error(err);
callback(err, null);
return;
}
if (data.length) {
callback(null, data[0]);
} else {
callback(null, null);
}
});
};

taskSchema.statics.getTaskById = function(taskId, callback) {
this.find({
Expand Down
17 changes: 16 additions & 1 deletion server/app/routes/v1.0/routes_blueprints.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,20 @@ module.exports.setRoutes = function(app, sessionVerificationFunc) {
});
});

app.delete('/blueprints/serviceDelivery/:blueprintId', function(req, res) {
Blueprints.removeServiceDeliveryBlueprints(req.params.taskId, function(err, data) {
if (err) {
logger.error("Failed to delete ", err);
res.send(500, errorResponses.db.error);
return;
}
res.send(200, {
message: "deleted"
});
});
});


// This post() Not in use
app.post('/blueprints', function(req, res) {
logger.debug("Enter post() for /blueprints");
Expand Down Expand Up @@ -427,7 +441,8 @@ module.exports.setRoutes = function(app, sessionVerificationFunc) {
ver: req.query.version,
stackName: stackName,
domainName:domainName,
sessionUser: req.session.user.cn
sessionUser: req.session.user.cn,
tagServer: req.query.tagServer
}, function(err, launchData) {
if (err) {
res.status(500).send({
Expand Down
25 changes: 25 additions & 0 deletions server/app/routes/v1.0/routes_instances.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,31 @@ module.exports.setRoutes = function(app, sessionVerificationFunc) {
});
});*/

// Instance list for tagging server
app.get('/instancesList', function(req, res, next) {

var reqData = {};
async.waterfall(
[
function(next) {
apiUtil.paginationRequest(req.query, 'instances', next);
},
function(paginationReq, next) {
reqData = paginationReq;
instancesDao.getInstanceList(paginationReq, next);
},
function(instances, next) {
apiUtil.paginationResponse(instances, reqData, next);
}
],
function(err, results) {
if (err)
next(err);
else
return res.status(200).send(results);
});
});

app.get('/instances', getInstanceList);

function getInstanceList(req, res, next) {
Expand Down
2 changes: 1 addition & 1 deletion server/app/routes/v1.0/routes_organizations.js
Original file line number Diff line number Diff line change
Expand Up @@ -1741,7 +1741,7 @@ module.exports.setRoutes = function(app, sessionVerification) {
instanceIP: req.body.fqdn,
instanceState: nodeAlive,
bootStrapStatus: 'waiting',
tagServer: req.body.tagServer,
tagServer: req.params.tagServer,
runlist: [],
appUrls: appUrls,
users: [req.session.user.cn], //need to change this
Expand Down
13 changes: 13 additions & 0 deletions server/app/routes/v1.0/routes_tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,19 @@ module.exports.setRoutes = function(app, sessionVerification) {
});
});

app.delete('/tasks/serviceDelivery/:taskId', function(req, res) {
Tasks.removeServiceDeliveryTask(req.params.taskId, function(err, data) {
if (err) {
logger.error("Failed to delete service delivery Task", err);
res.send(500, errorResponses.db.error);
return;
}
res.send(200, {
message: "deleted"
});
});
});

app.get('/tasks/history/list/all', function(req, res) {
logger.debug("------------------ ",JSON.stringify(TaskHistory));
TaskHistory.listHistory(function(err, tHistories) {
Expand Down