Example #1
0
File: client.go Project: bac/juju
// AddCharmWithAuthorization adds the given charm URL (which must include revision) to
// the model, if it does not exist yet. Local charms are not
// supported, only charm store URLs. See also AddLocalCharm().
//
// The authorization macaroon, args.CharmStoreMacaroon, may be
// omitted, in which case this call is equivalent to AddCharm.
func (c *Client) AddCharmWithAuthorization(args params.AddCharmWithAuthorization) error {
	if err := c.checkCanWrite(); err != nil {
		return err
	}

	return application.AddCharmWithAuthorization(c.api.state(), args)
}
Example #2
0
File: client.go Project: bac/juju
func (c *Client) AddCharm(args params.AddCharm) error {
	if err := c.checkCanWrite(); err != nil {
		return err
	}

	return application.AddCharmWithAuthorization(c.api.state(), params.AddCharmWithAuthorization{
		URL:     args.URL,
		Channel: args.Channel,
	})
}