backtrace-morgue
Advanced tools
Comparing version 0.7.0 to 0.8.0
@@ -90,2 +90,3 @@ #!/usr/bin/env node | ||
list: coronerList, | ||
control: coronerControl, | ||
ls: coronerList, | ||
@@ -152,2 +153,54 @@ describe: coronerDescribe, | ||
function coronerControl(argv, config) { | ||
var universe, project; | ||
abortIfNotLoggedIn(config); | ||
var coroner = new CoronerClient({ | ||
insecure: !!argv.k, | ||
debug: !!argv.debug, | ||
config: config.config, | ||
endpoint: config.endpoint, | ||
timeout: argv.timeout | ||
}); | ||
if (Array.isArray(argv._) === true && argv._.length > 1) { | ||
var split; | ||
split = argv._[1].split('/'); | ||
if (split.length === 1) { | ||
var first; | ||
/* Try to automatically derive a path from the one argument. */ | ||
for (first in config.config.universes) break; | ||
universe = first; | ||
project = argv._[1]; | ||
} else { | ||
universe = split[0]; | ||
project = split[1]; | ||
} | ||
} | ||
if (argv.smr) { | ||
coroner.control({ 'action': 'graceperiod' }, function(error, r) { | ||
if (error) { | ||
var message = 'Error: '; | ||
if (error.message) { | ||
message += error.message; | ||
} else { | ||
message += error; | ||
} | ||
if (error === 'invalid token') | ||
message = message + ': try logging in again.'; | ||
console.log(message.error); | ||
process.exit(); | ||
} | ||
console.log('Success'.blue); | ||
}); | ||
} | ||
} | ||
function coronerGet(argv, config) { | ||
@@ -173,6 +226,6 @@ var universe, project, object, rf; | ||
} | ||
object = argv._[2]; | ||
} | ||
object = argv._[2]; | ||
const insecure = !!argv.k; | ||
@@ -179,0 +232,0 @@ const debug = argv.debug; |
@@ -151,3 +151,4 @@ "use strict"; | ||
if (this.debug) { | ||
console.error("POST " + options.path); | ||
console.error("POST " + options.protocol + '://' + options.host + | ||
options.path); | ||
console.error(payload); | ||
@@ -224,2 +225,8 @@ } | ||
CoronerClient.prototype.control = function(action, callback) { | ||
action.token = this.config.token; | ||
this.post("/control", null, action, callback); | ||
}; | ||
CoronerClient.prototype.query = function(universe, project, query, callback) { | ||
@@ -226,0 +233,0 @@ var params = { |
{ | ||
"name": "backtrace-morgue", | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"description": "command line interface to the Backtrace object store", | ||
@@ -5,0 +5,0 @@ "main": "./lib/coroner.js", |
@@ -38,6 +38,2 @@ # morgue | ||
### dashboard | ||
Not implemented yet. | ||
### describe | ||
@@ -63,4 +59,9 @@ | ||
Not implemented yet. | ||
``` | ||
Usage: morgue get <[<universe>/]project> <object id> [-o <output file>] | ||
``` | ||
Downloads the specified object from the Backtrace object store and prints | ||
to standard output. Optionally, output the file to disk. | ||
### list | ||
@@ -102,4 +103,5 @@ | ||
| `--head` | provide the first value in a factor | | ||
| `--tail` | provide the last value in a factor | | ||
| `--object` | provide the maximum object identifier of a column | | ||
#### Example | ||
@@ -106,0 +108,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1392
172
74633
10