diff --git a/CHANGES.md b/CHANGES.md index 3228f91..e495370 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 diff --git a/lib/do_volume/do_list.js b/lib/do_volume/do_list.js index 9b16a82..147650f 100644 --- a/lib/do_volume/do_list.js +++ b/lib/do_volume/do_list.js @@ -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');