Skip to content

Commit c33ea06

Browse files
Merge pull request #2 from NCIOCPL/goac
Goac
2 parents 8711140 + 19fc37a commit c33ea06

5 files changed

Lines changed: 13 additions & 4 deletions

File tree

bin/estools

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ require('../cmds/isindexavailable.js')(program);
1818

1919
program
2020
//Common options to ALL commands.
21+
.option('-P, --protocol <protocol>', 'http or https. (default: http)', 'http')
22+
2123
.option(
2224
'-s --server <server>',
2325
'The elasticsearch node IP or Name to connect to. (default: localhost)',

cmds/indexesforalias.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ internals.commandAction = function(aliasname, cmd) {
4141
//Add Verbose Check
4242
if (cmd.parent.verbose) {
4343
console.log("Alias Name: " + aliasname);
44+
console.log("Protocol: " + cmd.parent.protocol);
4445
console.log("Server: " + cmd.parent.server);
4546
console.log("Port: " + cmd.parent.port);
47+
console.log(cmd.parent.protocol + '://' + cmd.parent.server + ':' + cmd.parent.port);
4648
}
4749

4850
//Setup elastic search client.
4951
var client = new elasticsearch.Client({
50-
host: 'http://' + cmd.parent.server + ':' + cmd.parent.port,
52+
host: cmd.parent.protocol + '://' + cmd.parent.server + ':' + cmd.parent.port,
5153
log: 'error'
5254
});
5355

cmds/isindexavailable.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,15 @@ internals.commandAction = function(indexname, cmd) {
4040
//Add Verbose Check
4141
if (cmd.parent.verbose) {
4242
console.log("Index Name: " + indexname);
43+
console.log("Protocol: " + cmd.parent.protocol);
4344
console.log("Server: " + cmd.parent.server);
4445
console.log("Port: " + cmd.parent.port);
46+
console.log(cmd.parent.protocol + '://' + cmd.parent.server + ':' + cmd.parent.port);
4547
}
4648

4749
//Setup elastic search client.
4850
var client = new elasticsearch.Client({
49-
host: 'http://' + cmd.parent.server + ':' + cmd.parent.port,
51+
host: cmd.parent.protocol + '://' + cmd.parent.server + ':' + cmd.parent.port,
5052
log: 'error'
5153
});
5254

cmds/oldsnapshots.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,18 @@ internals.commandAction = function(repository, cmd) {
5757
if (cmd.parent.verbose) {
5858
console.log("Repository: " + repository);
5959
console.log("Number of Days: " + cmd.num_days);
60+
console.log("Protocol: " + cmd.parent.protocol);
6061
console.log("Server: " + cmd.parent.server); //Program Option
6162
console.log("Port: " + cmd.parent.port); //Program Option
63+
console.log(cmd.parent.protocol + '://' + cmd.parent.server + ':' + cmd.parent.port);
6264
}
6365

6466
//So we should be good to go here.
6567
internals.getSnapshotsFromRepo(
6668
{
6769
repo: repository,
6870
num_days: cmd.num_days,
71+
protocol: cmd.parent.protocol,
6972
server: cmd.parent.server,
7073
port: cmd.parent.port
7174
}, function(err, results) {
@@ -103,7 +106,7 @@ internals.getSnapshotsFromRepo = function(opts, resultsCallback) {
103106

104107
//Setup elastic search client.
105108
var client = new elasticsearch.Client({
106-
host: 'http://' + opts.server + ':' + opts.port,
109+
host: opts.protocol + '://' + opts.server + ':' + opts.port,
107110
log: 'error'
108111
});
109112

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"dependencies": {
2424
"autocmdr": "~0.0.7",
2525
"commander": "~2.0.0",
26-
"elasticsearch": "^10.1.2",
26+
"elasticsearch": "^13.3.1",
2727
"lodash": "^4.0.0",
2828
"moment": "^2.11.1"
2929
},

0 commit comments

Comments
 (0)