Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@
"enableREQueryAndSortCriteria": true,
"relationships": {
"entityNameSeparator": "."
},
"checkAwsCredentials": true
}
}
},
"description": "Hackolade plugin for Amazon DocumentDB",
Expand Down
41 changes: 41 additions & 0 deletions reverse_engineering/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,47 @@ module.exports = {
}
},

async validateConnection(connectionInfo, logger, cb) {
const log = createLogger({
title: 'Validate connection',
hiddenKeys: connectionInfo.hiddenKeys,
logger,
});

try {
logger.clear();
log.info(getSystemInfo(connectionInfo.appVersion));
log.info(connectionInfo, 'connectionInfo');

const docDbClientInstance = await getDocDbClientInstance({
connectionInfo: {
...connectionInfo,
...parseHost(connectionInfo.host, log),
},
logger: log,
});

log.info('Getting cluster information');

const cluster = await docDbClientInstance.getCluster();

if (!cluster) {
cb(null, "Cluster doesn't exist in the chosen region.");
}

log.info('Cluster information retrieved successfully');

cb();
} catch (error) {
log.error(error);

return cb({
message: error.message,
stack: error.stack,
});
}
},

async getDbCollectionsNames(connectionInfo, logger, cb, app) {
const sshService = app.require('@hackolade/ssh-service');

Expand Down