Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
add cli helper for listing snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
smithclay committed Nov 19, 2020
1 parent 844f176 commit 924d06e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,22 @@ yargs.command('take-snapshot <query>', 'take a snapshot for a query', (yargs) =>
return Promise.resolve()
})

yargs.command('snapshots', 'list snapshots', (yargs) => {
yargs
.positional('project', {
describe : 'Lightstep project id',
required : true,
type : 'string',
default : process.env.LIGHTSTEP_PROJECT
})
}, async (argv) => {
const sdkClient = await sdk.init(argv.lightstepOrganization,
argv.lightstepApiKey)
const snapshots = await sdkClient.getSnapshots({ project : argv.project })
console.log(JSON.stringify(snapshots, null, 2))
return Promise.resolve()
})

yargs.command('snapshot <id>', 'retrieve a snapshot for a query', (yargs) => {
yargs
.positional('project', {
Expand Down

0 comments on commit 924d06e

Please sign in to comment.