return new Promise(function(resolve, reject) {
Promise.all([
rp({
- uri: utils.confdPort(api_server) + APIVersion + '/api/config/nsd-catalog/nsd?deep',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/config/nsd-catalog/nsd?deep'),
method: 'GET',
headers: _.extend({}, constants.HTTP_HEADERS.accept.collection, {
'Authorization': req.session && req.session.authorization
resolveWithFullResponse: true
}),
rp({
- uri: utils.confdPort(api_server) + APIVersion + '/api/config/vnfd-catalog/vnfd?deep',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/config/vnfd-catalog/vnfd?deep'),
method: 'GET',
headers: _.extend({}, constants.HTTP_HEADERS.accept.collection, {
'Authorization': req.session && req.session.authorization
resolveWithFullResponse: true
}),
rp({
- uri: utils.confdPort(api_server) + APIVersion + '/api/operational/ns-instance-opdata?deep',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/operational/ns-instance-opdata?deep'),
method: 'GET',
headers: _.extend({}, constants.HTTP_HEADERS.accept.data, {
'Authorization': req.session && req.session.authorization
console.log('Deleting', catalogType, id, 'from', api_server);
return new Promise(function(resolve, reject) {
request({
- uri: utils.confdPort(api_server) + APIVersion + '/api/config/' + catalogType + '-catalog/' + catalogType + '/' + id,
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/config/' + catalogType + '-catalog/' + catalogType + '/' + id),
method: 'DELETE',
headers: _.extend({}, constants.HTTP_HEADERS.accept.data, {
'Authorization': req.session && req.session.authorization
return new Promise(function(resolve, reject) {
var url = utils.confdPort(api_server) + APIVersion + '/api/config/vnfd-catalog/vnfd' + (id ? '/' + id : '') + '?deep';
request({
- uri: url,
+ uri: utils.projectContextUrl(req, url),
method: 'GET',
headers: _.extend({}, constants.HTTP_HEADERS.accept.data, {
'Authorization': authorization
'Authorization': req.session && req.session.authorization
});
request({
- uri: utils.confdPort(api_server) + '/api/config/' + catalogType + '-catalog',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + '/api/config/' + catalogType + '-catalog'),
method: 'POST',
headers: requestHeaders,
forever: constants.FOREVER_ON,
'Authorization': req.session && req.session.authorization
});
request({
- uri: utils.confdPort(api_server) + APIVersion + '/api/config/' + catalogType + '-catalog' + '/' + catalogType + '/' + id,
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/config/' + catalogType + '-catalog' + '/' + catalogType + '/' + id),
method: 'PUT',
headers: requestHeaders,
forever: constants.FOREVER_ON,
return new Promise(function(resolve, reject) {
Promise.all([
rp({
- uri: utils.confdPort(api_server) + '/api/operations/package-update',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + '/api/operations/package-update'),
method: 'POST',
headers: _.extend({}, constants.HTTP_HEADERS.accept.collection, {
'Authorization': req.session && req.session.authorization
return new Promise(function(resolve, reject) {
Promise.all([
rp({
- uri: utils.confdPort(api_server) + '/api/operations/package-create',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + '/api/operations/package-create'),
method: 'POST',
headers: _.extend({}, constants.HTTP_HEADERS.accept.collection, {
'Authorization': req.session && req.session.authorization
return new Promise(function(resolve, reject) {
Promise.all([
rp({
- uri: utils.confdPort(api_server) + '/api/operations/package-file-add',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + '/api/operations/package-file-add'),
method: 'POST',
headers: _.extend({}, constants.HTTP_HEADERS.accept.collection, {
'Authorization': req.session && req.session.authorization
return new Promise(function(resolve, reject) {
Promise.all([
rp({
- uri: utils.confdPort(api_server) + '/api/operations/package-export',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + '/api/operations/package-export'),
method: 'POST',
headers: _.extend({}, constants.HTTP_HEADERS.accept.collection, {
'Authorization': req.session && req.session.authorization
function deleteFile(payload) {
return new Promise(function(resolve, reject) {
rp({
- uri: utils.confdPort(api_server) + '/api/operations/rw-pkg-mgmt:package-file-delete',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + '/api/operations/rw-pkg-mgmt:package-file-delete'),
method: 'POST',
headers: _.extend({}, constants.HTTP_HEADERS.accept.collection, {
'Authorization': req.session && req.session.authorization
function download(payload) {
return new Promise(function(resolve, reject) {
rp({
- uri: utils.confdPort(api_server) + '/api/operations/rw-pkg-mgmt:package-file-add',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + '/api/operations/rw-pkg-mgmt:package-file-add'),
method: 'POST',
headers: _.extend({}, constants.HTTP_HEADERS.accept.collection, {
'Authorization': req.session && req.session.authorization
function list(payload) {
return new Promise(function(resolve, reject) {
rp({
- uri: utils.confdPort(api_server) + '/api/operations/get-package-endpoint',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + '/api/operations/get-package-endpoint'),
method: 'POST',
headers: _.extend({}, constants.HTTP_HEADERS.accept.collection, {
'Authorization': req.session && req.session.authorization
}
parsedEndpoint = URL.parse(endpoint);
rp({
- uri: api_server + ':' + parsedEndpoint.port + parsedEndpoint.path,
+ uri: utils.projectContextUrl(req, api_server + ':' + parsedEndpoint.port + parsedEndpoint.path),
method: 'GET',
headers: _.extend({}, constants.HTTP_HEADERS.accept.collection, {
'Authorization': req.session && req.session.authorization
var id = req.params['id'];
return new Promise(function(resolve, reject) {
request({
- url: uri + url + '?deep',
+ url: utils.projectContextUrl(req, uri + url + '?deep'),
method: 'GET',
headers: _.extend({}, constants.HTTP_HEADERS.accept.data, {
'Authorization': req.session && req.session.authorization
}
);
request({
- url: utils.confdPort(api_server) + APIVersion + '/api/operations/exec-ns-service-primitive',
+ url: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/operations/exec-ns-service-primitive'),
method: 'POST',
headers: headers,
forever: constants.FOREVER_ON,
}
);
request({
- uri: utils.confdPort(api_server) + APIVersion + '/api/operations/get-ns-service-primitive-values',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/operations/get-ns-service-primitive-values'),
method: 'POST',
headers: headers,
forever: constants.FOREVER_ON,
return new Promise(function(resolve, reject) {
request({
- uri: utils.confdPort(api_server) + APIVersion + '/api/operations/' + rpcInfo[Type].rpc,
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/operations/' + rpcInfo[Type].rpc),
method: 'POST',
headers: headers,
forever: constants.FOREVER_ON,
return new Promise(function(resolve, reject) {
Promise.all([
rp({
- uri: utils.confdPort(api_server) + APIVersion + '/api/config/nsd-catalog/nsd?deep',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/config/nsd-catalog/nsd?deep'),
method: 'GET',
headers: _.extend({}, constants.HTTP_HEADERS.accept.collection, {
'Authorization': req.session && req.session.authorization
resolveWithFullResponse: true
}),
rp({
- uri: utils.confdPort(api_server) + APIVersion + '/api/config/vnfd-catalog/vnfd?deep',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/config/vnfd-catalog/vnfd?deep'),
method: 'GET',
headers: _.extend({}, constants.HTTP_HEADERS.accept.collection, {
'Authorization': req.session && req.session.authorization
resolveWithFullResponse: true
}),
rp({
- uri: utils.confdPort(api_server) + APIVersion + '/api/operational/ns-instance-opdata?deep',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/operational/ns-instance-opdata?deep'),
method: 'GET',
headers: _.extend({}, constants.HTTP_HEADERS.accept.data, {
'Authorization': req.session && req.session.authorization
console.log('Deleting', catalogType, id, 'from', api_server);
return new Promise(function(resolve, reject) {
request({
- uri: utils.confdPort(api_server) + APIVersion + '/api/config/' + catalogType + '-catalog/' + catalogType + '/' + id,
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/config/' + catalogType + '-catalog/' + catalogType + '/' + id),
method: 'DELETE',
headers: _.extend({}, constants.HTTP_HEADERS.accept.data, {
'Authorization': req.session && req.session.authorization
return new Promise(function(resolve, reject) {
var url = utils.confdPort(api_server) + APIVersion + '/api/config/vnfd-catalog/vnfd' + (id ? '/' + id : '') + '?deep';
request({
- uri: url,
+ uri: utils.projectContextUrl(req, url),
method: 'GET',
headers: _.extend({}, constants.HTTP_HEADERS.accept.data, {
'Authorization': authorization
'Authorization': req.session && req.session.authorization
});
request({
- uri: utils.confdPort(api_server) + APIVersion + '/api/config/' + catalogType + '-catalog',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/config/' + catalogType + '-catalog'),
method: 'POST',
headers: requestHeaders,
forever: constants.FOREVER_ON,
'Authorization': req.session && req.session.authorization
});
request({
- uri: utils.confdPort(api_server) + APIVersion + '/api/config/' + catalogType + '-catalog' + '/' + catalogType + '/' + id,
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/config/' + catalogType + '-catalog' + '/' + catalogType + '/' + id),
method: 'PUT',
headers: requestHeaders,
forever: constants.FOREVER_ON,
var id = req.params.id;
var nsdInfo = new Promise(function(resolve, reject) {
request({
- uri: utils.confdPort(api_server) + APIVersion + '/api/config/nsd-catalog/nsd?deep',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/config/nsd-catalog/nsd?deep'),
method: 'GET',
headers: _.extend({}, constants.HTTP_HEADERS.accept.collection, {
'Authorization': req.session && req.session.authorization
})
var config = new Promise(function(resolve, reject) {
request({
- uri: utils.confdPort(api_server) + APIVersion + '/api/operational/ns-instance-config/nsr' + (id ? '/' + id : '') + '?deep',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/operational/ns-instance-config/nsr' + (id ? '/' + id : '') + '?deep'),
method: 'GET',
headers: _.extend({}, id ? constants.HTTP_HEADERS.accept.data : constants.HTTP_HEADERS.accept.collection, {
'Authorization': req.session && req.session.authorization
});
var opData = new Promise(function(resolve, reject) {
request({
- uri: utils.confdPort(api_server) + APIVersion + '/api/operational/ns-instance-opdata/nsr' + (id ? '/' + id : '') + '?deep',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/operational/ns-instance-opdata/nsr' + (id ? '/' + id : '') + '?deep'),
method: 'GET',
headers: _.extend({}, id ? constants.HTTP_HEADERS.accept.data : constants.HTTP_HEADERS.accept.collection, {
'Authorization': req.session && req.session.authorization
'Authorization': req.session && req.session.authorization
});
request({
- uri: utils.confdPort(api_server) + APIVersion + '/api/config/ns-instance-config',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/config/ns-instance-config'),
method: 'POST',
headers: requestHeaders,
forever: constants.FOREVER_ON,
'Authorization': req.session && req.session.authorization
});
request({
- uri: utils.confdPort(api_server) + APIVersion + '/api/config/ns-instance-config/nsr/' + id,
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/config/ns-instance-config/nsr/' + id),
method: 'DELETE',
headers: requestHeaders,
forever: constants.FOREVER_ON,
'Authorization': req.session && req.session.authorization
});
request({
- uri: utils.confdPort(api_server) + APIVersion + '/api/config/ns-instance-config/nsr/' + id + '/admin-status/',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/config/ns-instance-config/nsr/' + id + '/admin-status/'),
method: 'PUT',
headers: requestHeaders,
json: {
);
request({
- uri: utils.confdPort(api_server) + APIVersion + '/api/config/ns-instance-config/nsr/' + id + '/scaling-group/' + scaling_group_id + '/instance',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/config/ns-instance-config/nsr/' + id + '/scaling-group/' + scaling_group_id + '/instance'),
method: 'POST',
headers: requestHeaders,
json: jsonData,
);
request({
- uri: utils.confdPort(api_server) + APIVersion + '/api/config/ns-instance-config/nsr/' + id + '/scaling-group/' + scaling_group_id + '/instance/' + scaling_instance_id,
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/config/ns-instance-config/nsr/' + id + '/scaling-group/' + scaling_group_id + '/instance/' + scaling_instance_id),
method: 'DELETE',
headers: requestHeaders,
forever: constants.FOREVER_ON,
);
request({
- uri: utils.confdPort(api_server) + APIVersion + '/api/config/ns-instance-config/nsr/' + nsr_id + '/nsd/vld' + (vld_id ? '/' + vld_id : '') +'?deep',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/config/ns-instance-config/nsr/' + nsr_id + '/nsd/vld' + (vld_id ? '/' + vld_id : '') +'?deep'),
method: 'GET',
headers: requestHeaders,
forever: constants.FOREVER_ON,
'Authorization': req.session && req.session.authorization
});
request({
- uri: utils.confdPort(api_server) + '/api/config/ns-instance-config/nsr/' + nsr_id + '/nsd/vld' + (vld_id ? '/' + vld_id : ''),
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + '/api/config/ns-instance-config/nsr/' + nsr_id + '/nsd/vld' + (vld_id ? '/' + vld_id : '')),
method: vld_id ? 'PUT' : 'POST',
headers: requestHeaders,
forever: constants.FOREVER_ON,
);
request({
- uri: utils.confdPort(api_server) + APIVersion + '/api/config/ns-instance-config/nsr/' + nsr_id + '/nsd/vld/' + vld_id,
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/config/ns-instance-config/nsr/' + nsr_id + '/nsd/vld/' + vld_id),
method: 'DELETE',
headers: requestHeaders,
forever: constants.FOREVER_ON,
});
return new Promise(function(resolve, reject) {
request({
- url: uri,
+ url: utils.projectContextUrl(req, uri),
method: 'GET',
headers: headers,
forever: constants.FOREVER_ON,
});
} else {
request({
- url: uri,
+ url: utils.projectContextUrl(req, uri),
method: 'GET',
headers: headers,
forever: constants.FOREVER_ON,
});
return new Promise(function(resolve, reject) {
request({
- url: uri,
+ url: utils.projectContextUrl(req, uri),
method: 'GET',
headers: headers,
forever: constants.FOREVER_ON,
var url = req.path;
return new Promise(function(resolve, reject) {
request({
- url: uri + url + '?deep',
+ url: utils.projectContextUrl(req, uri + url + '?deep'),
method: 'GET',
headers: _.extend({}, constants.HTTP_HEADERS.accept.data, {
'Authorization': req.session && req.session.authorization
return new Promise(function(resolve, reject) {
var nsrPromise = new Promise(function(success, failure) {
request({
- uri: utils.confdPort(api_server) + APIVersion + '/api/operational/ns-instance-opdata/nsr/' + nsr_id + '?deep',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/operational/ns-instance-opdata/nsr/' + nsr_id + '?deep'),
method: 'GET',
headers: _.extend({},
constants.HTTP_HEADERS.accept.data, {
vnfrPromises.push(
new Promise(function(success, failure) {
rp({
- uri: utils.confdPort(api_server) + APIVersion + '/api/operational/vnfr-catalog/vnfr/' + vnfrId + '?deep',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/operational/vnfr-catalog/vnfr/' + vnfrId + '?deep'),
method: 'GET',
headers: _.extend({}, constants.HTTP_HEADERS.accept.data, {
'Authorization': req.session && req.session.authorization
});
return new Promise(function(resolve, reject) {
request({
- url: uri,
+ url: utils.projectContextUrl(req, uri),
method: 'GET',
headers: headers,
forever: constants.FOREVER_ON,
});
return new Promise(function(resolve, reject) {
request({
- url: uri,
+ url: utils.projectContextUrl(req, uri),
method: 'GET',
headers: headers,
forever: constants.FOREVER_ON,
});
return new Promise(function(resolve, reject) {
request({
- url: uri,
+ url: utils.projectContextUrl(req, uri),
method: 'GET',
headers: headers,
forever: constants.FOREVER_ON,
});
return new Promise(function(resolve, reject) {
request({
- url: uri,
+ url: utils.projectContextUrl(req, uri),
method: 'GET',
headers: headers,
forever: constants.FOREVER_ON,
});
request({
- url: utils.confdPort(api_server) + APIVersion + '/api/operational/config-agent/account',
+ url: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/operational/config-agent/account'),
type: 'GET',
headers: requestHeaders,
forever: constants.FOREVER_ON,
});
request({
- url: utils.confdPort(api_server) + APIVersion + '/api/operational/config-agent/account/' + id,
+ url: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/operational/config-agent/account/' + id),
type: 'GET',
headers: requestHeaders,
forever: constants.FOREVER_ON,
});
request({
- url: utils.confdPort(api_server) + APIVersion + '/api/config/config-agent',
+ url: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/config/config-agent'),
method: 'POST',
headers: requestHeaders,
forever: constants.FOREVER_ON,
});
request({
- url: utils.confdPort(api_server) + APIVersion + '/api/config/config-agent/account/' + id,
+ url: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/config/config-agent/account/' + id),
method: 'PUT',
headers: requestHeaders,
forever: constants.FOREVER_ON,
'Authorization': req.session && req.session.authorization
});
request({
- url: utils.confdPort(api_server) + APIVersion + '/api/config/config-agent/account/' + id,
+ url: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/config/config-agent/account/' + id),
method: 'DELETE',
headers: requestHeaders,
forever: constants.FOREVER_ON,
'Authorization': req.session && req.session.authorization
});
request({
- url: utils.confdPort(api_server) + APIVersion + '/api/operational/datacenters?deep',
+ url: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/operational/datacenters?deep'),
method: 'GET',
headers: requestHeaders,
forever: constants.FOREVER_ON,
'Authorization': req.session && req.session.authorization
});
request({
- url: utils.confdPort(api_server) + APIVersion + '/api/config/key-pair?deep',
+ url: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/config/key-pair?deep'),
method: 'GET',
headers: requestHeaders,
forever: constants.FOREVER_ON,
console.log('Deleting ssk-key', id);
return new Promise(function(resolve, reject) {
request({
- uri: utils.confdPort(api_server) + APIVersion + '/api/config/key-pair/' + id,
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/config/key-pair/' + id),
method: 'DELETE',
headers: _.extend({}, constants.HTTP_HEADERS.accept.data, {
'Authorization': req.session && req.session.authorization
var data = req.body;
return new Promise(function(resolve, reject) {
request({
- uri: utils.confdPort(api_server) + APIVersion + '/api/config/key-pair/',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/config/key-pair/'),
method: 'POST',
headers: _.extend({}, constants.HTTP_HEADERS.accept.data, {
'Authorization': req.session && req.session.authorization
var data = req.body;
return new Promise(function(resolve, reject) {
request({
- uri: utils.confdPort(api_server) + APIVersion + '/api/config/key-pair/',
+ uri: utils.projectContextUrl(req, utils.confdPort(api_server) + APIVersion + '/api/config/key-pair/'),
method: 'PUT',
headers: _.extend({}, constants.HTTP_HEADERS.accept.data, {
'Authorization': req.session && req.session.authorization