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
3 changes: 2 additions & 1 deletion modules/application/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1380,7 +1380,7 @@ module.exports = {

try {
const credentials = await self.apos.modules.exn.getApplicationInfluxDBCredentials(doc.uuid)

console.log("Got application influxDBCredentials ",credentials)
if (!credentials) {
throw self.apos.error('error', "Could not retrieve credentials");
}
Expand Down Expand Up @@ -1417,6 +1417,7 @@ module.exports = {
const interval = req.query.interval || '-30d'

const credentials = await self.apos.modules.exn.getApplicationInfluxDBCredentials(doc.uuid)
console.log("Got credentials ",credentials)
if (!credentials) {
throw self.apos.error('error', "Could not retrieve credentials");
}
Expand Down
12 changes: 8 additions & 4 deletions modules/exn/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ module.exports = {
correlations[context.message.correlation_id]['resolve'](context.message.body)
return
}
if (context.message.to === "topic://eu.nebulouscloud.app_cluster.influxdb.get.reply") {
correlations[context.message.correlation_id]['resolve'](context.message.body)
return
}

if (context.message.correlation_id in correlations) {
if (context.message.body.metaData['status'] >= 400) {
Expand All @@ -137,6 +141,7 @@ module.exports = {
context.connection.open_receiver('topic://eu.nebulouscloud.ui.user.get')
context.connection.open_receiver('topic://eu.nebulouscloud.ui.app.get')
context.connection.open_receiver('topic://eu.nebulouscloud.ontology.bqa.reply')
context.connection.open_receiver('topic://eu.nebulouscloud.app_cluster.influxdb.get.reply')

sender_sal_nodecandidate_get = context.connection.open_sender('topic://eu.nebulouscloud.exn.sal.nodecandidate.get');
sender_sal_cloud_get = context.connection.open_sender('topic://eu.nebulouscloud.exn.sal.cloud.get');
Expand Down Expand Up @@ -403,13 +408,12 @@ module.exports = {
to: sender_app_influxdb.options.target.address,
correlation_id: correlation_id,
message_annotations: {application: uuid},
application_properties: {application: uuid}
application_properties: {application: uuid},
body:""
}
const timer = setTimeout(() => {
console.warn("InfluxDB Crendetials not retrieved for application = ",uuid)
resolve({
'valid':true
})
resolve(false)
}, 7000);

console.log("[getApplicationInfluxDBCrendetials] Send ", JSON.stringify( message))
Expand Down