joyent/node-triton#217 `triton volume ls -l` should output a `RESOURCE` column

Reviewed by: Trent Mick <trentm@gmail.com>
Approved by: Trent Mick <trentm@gmail.com>
This commit is contained in:
Julien Gilli 2017-07-27 16:36:00 -07:00
parent a5ab0f686b
commit c56d0a25da
2 changed files with 9 additions and 2 deletions

View File

@ -7,7 +7,8 @@ Known issues:
## not yet released
(nothing yet)
- [joyent/node-triton#217] `triton volume ls -l` should output a `RESOURCE`
column.
## 5.3.0

View File

@ -31,7 +31,7 @@ var validFilters = [
var columnsDefault = 'shortid,name,size,type,state,age';
// columns default with -l
var columnsDefaultLong = 'id,name,size,type,state,created';
var columnsDefaultLong = 'id,name,size,type,resource,state,created';
// sort default with -s
var sortDefault = 'created';
@ -98,6 +98,10 @@ function do_list(subcmd, opts, args, callback) {
created = new Date(volume.create_timestamp);
if (volume.filesystem_path !== undefined) {
volume.resource = volume.filesystem_path;
}
volume.shortid = volume.id.split('-', 1)[0];
volume.created = volume.create_timestamp;
volume.age = common.longAgo(created, now);
@ -142,6 +146,8 @@ do_list.help = [
'for convenience):',
' shortid* A short ID prefix.',
' age* Approximate time since created, e.g. 1y, 2w.',
' resource* A locator usable by clients to make use of the ',
' volume\'s resources',
''
/* END JSSTYLED */
].join('\n');