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, 24 insertions, 0 deletions
diff --git a/lib/inventory.js b/lib/inventory.js
index 5935067..0d06856 100644
--- a/lib/inventory.js
+++ b/lib/inventory.js
@@ -24,6 +24,7 @@ const createError = require('./dispatcher-error').createDispatcherError;
const INV_SERV_TYPES = '/dcae-service-types';
const INV_SERVICES = '/dcae-services';
+const INV_SERVICE_HEALTH = '/servicehealth';
/*
* Common error handling for inventory API calls
@@ -162,6 +163,29 @@ module.exports = function(options) {
return invError(err);
}
});
+ },
+
+ /*
+ * Check if inventory service is healthy using inventory's service check api
+ */
+
+ isServiceHealthy: function(req) {
+ return doRequest(req, {
+ method: "GET",
+ uri: url + INV_SERVICE_HEALTH
+ }, null, INVENTORY)
+
+ .then(function(res) {
+ if ( res.status == 200 ) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ },
+ function (err) {
+ return invError(err);
+ });
}
};
};