func (c *Client) AddUnits(args AddUnitsParams) ([]string, error) {
	if len(args.AttachStorage) > 0 {
		if args.NumUnits != 1 {
			return nil, errors.New("cannot attach existing storage when more than one unit is requested")
		}
		if c.BestAPIVersion() < 5 {
			return nil, errors.New("this juju controller does not support AttachStorage")
		}
	}
	attachStorage := make([]string, len(args.AttachStorage))
	for i, id := range args.AttachStorage {
		if !names.IsValidStorage(id) {
			return nil, errors.NotValidf("storage ID %q", id)
		}
		attachStorage[i] = names.NewStorageTag(id).String()
	}
	results := new(params.AddApplicationUnitsResults)
	err := c.facade.FacadeCall("AddUnits", params.AddApplicationUnits{
		ApplicationName: args.ApplicationName,
		NumUnits:        args.NumUnits,
		Placement:       args.Placement,
		Policy:          args.Policy,
		AttachStorage:   attachStorage,
	}, results)
	return results.Units, err
}
// AddUnits adds a given number of units to an application using the specified
// placement directives to assign units to machines.
AddUnits adds a given number of units to an application using the specified
placement directives to assign units to machines.
// AddUnits adds a given number of units to an application using the specified // placement directives to assign units to machines .
func (c *Client) AddUnits(args AddUnitsParams) ([]string, error) {
	if len(args.AttachStorage) > 0 {
		if args.NumUnits != 1 {
			return nil, errors.New("cannot attach existing storage when more than one unit is requested")
		}
		if c.BestAPIVersion() < 5 {
			return nil, errors.New("this juju controller does not support AttachStorage")
		}
	}
	attachStorage := make([]string, len(args.AttachStorage))
	for i, id := range args.AttachStorage {
		if !names.IsValidStorage(id) {
			return nil, errors.NotValidf("storage ID %q", id)
		}
		attachStorage[i] = names.NewStorageTag(id).String()
	}
	results := new(params.AddApplicationUnitsResults)
	err := c.facade.FacadeCall("AddUnits", params.AddApplicationUnits{
		ApplicationName: args.ApplicationName,
		NumUnits:        args.NumUnits,
		Placement:       args.Placement,
		Policy:          args.Policy,
		AttachStorage:   attachStorage,
	}, results)
	return results.Units, err
}
func ( c * Client ) AddUnits ( args AddUnitsParams ) ( [ ] string , error ) { if len ( args . AttachStorage ) > 0 { if args . NumUnits != 1 { return nil , errors . New ( " " ) } if c . BestAPIVersion ( ) < 5 { return nil , errors . New ( " " ) } } attachStorage := make ( [ ] string , len ( args . AttachStorage ) ) for i , id := range args . AttachStorage { if ! names . IsValidStorage ( id ) { return nil , errors . NotValidf ( " " , id ) } attachStorage [ i ] = names . NewStorageTag ( id ) . String ( ) } results := new ( params . AddApplicationUnitsResults ) err := c . facade . FacadeCall ( " " , params . AddApplicationUnits { ApplicationName : args . ApplicationName , NumUnits : args . NumUnits , Placement : args . Placement , Policy : args . Policy , AttachStorage : attachStorage , } , results ) return results . Units , err }
AddUnits adds a given number of units to an application using the specified
placement directives to assign units to machines.
AddUnits adds a given number of units to an application using the specified placement directives to assign units to machines .