cmd/juju/storage: add "list", tweak "show" #12

Merged
merged 2 commits into from Jan 28, 2015

Conversation

Projects
None yet
2 participants
Collaborator

axw commented Jan 28, 2015

This commit introduces "juju storage list" to list
all of the storage instances in the environment.
The default output is a tabular format, similar to
"juju status --format tabular".

The existing "juju storage show" has been tweaked
to output as a map, rather than a slice. This makes
the output more like "juju status". We also translate
tags to IDs (unit/service name, storage ID), as tags
are not intended for users' eyes.

The StorageName value is now computed from the storage
ID. Finally, the "location", "available-size" and
"total-size" fields are omitted if unavailable. To
effect this, we make their types pointers, so they
are nullable.

This commit requires juju/names#38

cmd/juju/storage: add "list", tweak "show"
This commit introduces "juju storage list" to list
all of the storage instances in the environment.
The default output is a tabular format, similar to
"juju status --format tabular".

The existing "juju storage show" has been tweaked
to output as a map, rather than a slice. This makes
the output more like "juju status". We also translate
tags to IDs (unit/service name, storage ID), as tags
are not intended for users' eyes.

The StorageName value is now computed from the storage
ID. Finally, the "location", "available-size" and
"total-size" fields are omitted if unavailable. To
effect this, we make their types pointers, so they
are nullable.

This commit requires juju/names#38
cmd/juju/storage/list.go
+-e, --environment (= "")
+ juju environment to operate in
+-o, --output (= "")
+ specify an output
@wallyworld

wallyworld Jan 28, 2015

Owner

an output file?

@axw

axw Jan 28, 2015

Collaborator

Indeed. Fixed here and in show.go, where I copied from :)

cmd/juju/storage/list.go
+func (c *ListCommand) Info() *cmd.Info {
+ return &cmd.Info{
+ Name: "list",
+ Purpose: "lists storage instance",
@wallyworld

wallyworld Jan 28, 2015

Owner

instances?

@axw

axw Jan 28, 2015

Collaborator

Done.

Owner

wallyworld commented Jan 28, 2015

LGTM, very nice

wallyworld added a commit that referenced this pull request Jan 28, 2015

Merge pull request #12 from axw/storage-list-show-tweaks
cmd/juju/storage: add "list", tweak "show"

@wallyworld wallyworld merged commit 7d700af into wallyworld:storage-feature Jan 28, 2015

wallyworld pushed a commit that referenced this pull request Oct 22, 2015

Merge branch 'master' into networking-user-docs
* master: (259 commits)
  bzr: switch to utils/bzr
  worker/uniter/remotestate: fix Actions test
  worker/uniter/remotestate: fix data race
  worker/uniter/remotestate: fix data race in test
  juju/series: new package
  Minimal fix for lp:1493850.
  Further refactoring
  Tweak func sig
  Code review fixes
  FIx data race in tests
  Correctly handle spaces in a test.
  Fix up the merge from PR#3217.
  Add comments identifying some of the steps in status test #12.
  Add comments identifying some of the steps in status test #4.
  Add comments identifying the status tests.
  Clean up a few status tests.
  Sync up the status-related API params.
  Ensure the status tests run.
  apiserver/common: fix tests
  Add package docs
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment