~juju-qa/ubuntu/xenial/juju/xenial-2.0-beta3

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/cmd/juju/storage/add.go

  • Committer: Martin Packman
  • Date: 2016-03-30 19:31:08 UTC
  • mfrom: (1.1.41)
  • Revision ID: martin.packman@canonical.com-20160330193108-h9iz3ak334uk0z5r
Merge new upstream source 2.0~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
        "github.com/juju/juju/storage"
17
17
)
18
18
 
19
 
func newAddCommand() cmd.Command {
 
19
// NewAddCommand returns a command used to add unit storage.
 
20
func NewAddCommand() cmd.Command {
20
21
        cmd := &addCommand{}
21
22
        cmd.newAPIFunc = func() (StorageAddAPI, error) {
22
23
                return cmd.NewStorageAPI()
54
55
There is no need to comma-separate ommitted constraints. 
55
56
 
56
57
Example:
57
 
    Add 3 ebs storage instances for "data" storage to unit u/0:     
 
58
    Add 3 ebs storage instances for "data" storage to unit u/0:
58
59
 
59
 
      juju storage add u/0 data=ebs,1024,3 
60
 
    or
61
 
      juju storage add u/0 data=ebs,3
62
 
    or
63
 
      juju storage add u/0 data=ebs,,3 
 
60
      juju add-storage u/0 data=ebs,1024,3 
 
61
    or
 
62
      juju add-storage u/0 data=ebs,3
 
63
    or
 
64
      juju add-storage u/0 data=ebs,,3 
64
65
    
65
66
    
66
67
    Add 1 storage instances for "data" storage to unit u/0 
67
68
    using default model provider pool:
68
69
 
69
 
      juju storage add u/0 data=1 
 
70
      juju add-storage u/0 data=1 
70
71
    or
71
 
      juju storage add u/0 data 
 
72
      juju add-storage u/0 data 
72
73
`
73
74
        addCommandAgs = `
74
75
<unit name> <storage directive> ...
93
94
// Init implements Command.Init.
94
95
func (c *addCommand) Init(args []string) (err error) {
95
96
        if len(args) < 2 {
96
 
                return errors.New("storage add requires a unit and a storage directive")
 
97
                return errors.New("add-storage requires a unit and a storage directive")
97
98
        }
98
99
 
99
100
        u := args[0]
109
110
// Info implements Command.Info.
110
111
func (c *addCommand) Info() *cmd.Info {
111
112
        return &cmd.Info{
112
 
                Name:    "add",
 
113
                Name:    "add-storage",
113
114
                Purpose: "adds unit storage dynamically",
114
115
                Doc:     addCommandDoc,
115
116
                Args:    addCommandAgs,