示例#1
0
文件: client.go 项目: 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)
}
示例#2
0
文件: client.go 项目: 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,
	})
}