Documentation ¶
Overview ¶
Package service contains api calls for functionality related to deploying and managing services and their related charms.
Index ¶
- Variables
- func AddCharmWithAuthorization(st *state.State, args params.AddCharmWithAuthorization) error
- func DeployService(st *state.State, owner string, args params.ServiceDeploy) error
- func ResolveCharms(st *state.State, args params.ResolveCharms) (params.ResolveCharmResults, error)
- func ServiceSetSettingsStrings(service *state.Service, settings map[string]string) error
- func StoreCharmArchive(st *state.State, curl *charm.URL, ch charm.Charm, r io.Reader, size int64, ...) error
- type API
- type Service
Constants ¶
This section is empty.
Variables ¶
var NewCharmStore = charmrepo.NewCharmStore
TODO - we really want to avoid this, which we can do by refactoring code requiring this to use interfaces. NewCharmStore instantiates a new charm store repository. It is defined at top level for testing purposes.
Functions ¶
func AddCharmWithAuthorization ¶
func AddCharmWithAuthorization(st *state.State, args params.AddCharmWithAuthorization) error
AddCharmWithAuthorization adds the given charm URL (which must include revision) to the environment, 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 DeployService ¶
DeployService fetches the charm from the charm store and deploys it. The logic has been factored out into a common function which is called by both the legacy API on the client facade, as well as the new service facade.
func ResolveCharms ¶
func ResolveCharms(st *state.State, args params.ResolveCharms) (params.ResolveCharmResults, error)
ResolveCharm resolves the best available charm URLs with series, for charm locations without a series specified.
func ServiceSetSettingsStrings ¶
ServiceSetSettingsStrings updates the settings for the given service, taking the configuration from a map of strings.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API implements the service interface and is the concrete implementation of the api end point.
func NewAPI ¶
func NewAPI( st *state.State, resources *common.Resources, authorizer common.Authorizer, ) (*API, error)
NewAPI returns a new service API facade.
func (*API) ServicesDeploy ¶
func (api *API) ServicesDeploy(args params.ServicesDeploy) (params.ErrorResults, error)
ServicesDeploy fetches the charms from the charm store and deploys them.
func (*API) SetMetricCredentials ¶
func (api *API) SetMetricCredentials(args params.ServiceMetricCredentials) (params.ErrorResults, error)
SetMetricCredentials sets credentials on the service.
type Service ¶
type Service interface {
SetMetricCredentials(args params.ServiceMetricCredentials) (params.ErrorResults, error)
}
Service defines the methods on the service API end point.