aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inventory.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/inventory.js')
-rw-r--r--lib/inventory.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/inventory.js b/lib/inventory.js
index c2e13c9..ecc790a 100644
--- a/lib/inventory.js
+++ b/lib/inventory.js
@@ -1,5 +1,5 @@
/*
-Copyright(c) 2017 AT&T Intellectual Property. All rights reserved.
+Copyright(c) 2018 AT&T Intellectual Property. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -55,7 +55,7 @@ module.exports = function(options) {
return {
/* Add a DCAE service to the inventory. Done after a deployment.*/
- addService: function(deploymentId, serviceType, vnfId, vnfType, vnfLocation, outputs) {
+ addService: function(req, deploymentId, serviceType, vnfId, vnfType, vnfLocation, outputs) {
/* Create the service description */
var serviceDescription =
@@ -83,23 +83,23 @@ module.exports = function(options) {
json: serviceDescription
};
- return doRequest(reqOptions, null, INVENTORY);
+ return doRequest(req, reqOptions, null, INVENTORY);
},
/* Remove a DCAE service from the inventory. Done after an undeployment. */
- deleteService: function(serviceId) {
- return doRequest({method: "DELETE", uri: url + INV_SERVICES + "/" + serviceId}, null, INVENTORY);
+ deleteService: function(req, serviceId) {
+ return doRequest(req, {method: "DELETE", uri: url + INV_SERVICES + "/" + serviceId}, null, INVENTORY);
},
/* Find running/deploying instances of services (with a given type name, if specified) */
- getServicesByType: function(query) {
+ getServicesByType: function(req, query) {
var options = {
method: 'GET',
uri: url + INV_SERVICES,
- qs: query || {}
+ qs: query
};
- return doRequest(options, null, INVENTORY)
+ return doRequest(req, options, null, INVENTORY)
.then (function (result) {
var services = [];
var content = JSON.parse(result.body);
@@ -113,8 +113,8 @@ module.exports = function(options) {
},
/* Find a blueprint given the service type ID -- return blueprint and type ID */
- getBlueprintByType: function(serviceTypeId) {
- return doRequest({
+ getBlueprintByType: function(req, serviceTypeId) {
+ return doRequest(req, {
method: "GET",
uri: url + INV_SERV_TYPES + '/' + serviceTypeId
}, null, INVENTORY)
@@ -138,8 +138,8 @@ module.exports = function(options) {
* deployment ID as service name. If it doesn't exist, the function
* resolves its promise. If it *does* exist, then it throws an error.
*/
- verifyUniqueDeploymentId: function(deploymentId) {
- return doRequest({
+ verifyUniqueDeploymentId: function(req, deploymentId) {
+ return doRequest(req, {
method: "GET",
uri: url + INV_SERVICES + "/" + deploymentId
}, null, INVENTORY)