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 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, archive CharmArchive) error
- type API
- func (api *API) AddRelation(args params.AddRelation) (params.AddRelationResults, error)
- func (api *API) AddUnits(args params.AddServiceUnits) (params.AddServiceUnitsResults, error)
- func (api *API) CharmRelations(p params.ServiceCharmRelations) (params.ServiceCharmRelationsResults, error)
- func (api *API) Deploy(args params.ServicesDeploy) (params.ErrorResults, error)
- func (api *API) Destroy(args params.ServiceDestroy) error
- func (api *API) DestroyRelation(args params.DestroyRelation) error
- func (api *API) DestroyUnits(args params.DestroyServiceUnits) error
- func (api *API) Expose(args params.ServiceExpose) error
- func (api *API) Get(args params.ServiceGet) (params.ServiceGetResults, error)
- func (api *API) GetCharmURL(args params.ServiceGet) (params.StringResult, error)
- func (api *API) GetConstraints(args params.GetServiceConstraints) (params.GetConstraintsResults, error)
- func (api *API) Set(p params.ServiceSet) error
- func (api *API) SetCharm(args params.ServiceSetCharm) error
- func (api *API) SetConstraints(args params.SetConstraints) error
- func (api *API) SetMetricCredentials(args params.ServiceMetricCredentials) (params.ErrorResults, error)
- func (api *API) Unexpose(args params.ServiceUnexpose) error
- func (api *API) Unset(p params.ServiceUnset) error
- func (api *API) Update(args params.ServiceUpdate) error
- type CharmArchive
- type Service
Constants ¶
This section is empty.
Variables ¶
var NewCharmStoreRepo = newCharmStoreFromClient
TODO - we really want to avoid this, which we can do by refactoring code requiring this to use interfaces. NewCharmStoreRepo instantiates a new charm store repository. It is exported 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 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.
func StoreCharmArchive ¶
func StoreCharmArchive(st *state.State, archive CharmArchive) error
StoreCharmArchive stores a charm archive in environment storage.
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) AddRelation ¶
func (api *API) AddRelation(args params.AddRelation) (params.AddRelationResults, error)
AddRelation adds a relation between the specified endpoints and returns the relation info.
func (*API) AddUnits ¶
func (api *API) AddUnits(args params.AddServiceUnits) (params.AddServiceUnitsResults, error)
AddUnits adds a given number of units to a service.
func (*API) CharmRelations ¶
func (api *API) CharmRelations(p params.ServiceCharmRelations) (params.ServiceCharmRelationsResults, error)
CharmRelations implements the server side of Service.CharmRelations.
func (*API) Deploy ¶
func (api *API) Deploy(args params.ServicesDeploy) (params.ErrorResults, error)
Deploy fetches the charms from the charm store and deploys them using the specified placement directives.
func (*API) Destroy ¶
func (api *API) Destroy(args params.ServiceDestroy) error
Destroy destroys a given service.
func (*API) DestroyRelation ¶
func (api *API) DestroyRelation(args params.DestroyRelation) error
DestroyRelation removes the relation between the specified endpoints.
func (*API) DestroyUnits ¶
func (api *API) DestroyUnits(args params.DestroyServiceUnits) error
DestroyUnits removes a given set of service units.
func (*API) Expose ¶
func (api *API) Expose(args params.ServiceExpose) error
Expose changes the juju-managed firewall to expose any ports that were also explicitly marked by units as open.
func (*API) Get ¶
func (api *API) Get(args params.ServiceGet) (params.ServiceGetResults, error)
Get returns the configuration for a service.
func (*API) GetCharmURL ¶
func (api *API) GetCharmURL(args params.ServiceGet) (params.StringResult, error)
GetCharmURL returns the charm URL the given service is running at present.
func (*API) GetConstraints ¶
func (api *API) GetConstraints(args params.GetServiceConstraints) (params.GetConstraintsResults, error)
GetConstraints returns the constraints for a given service.
func (*API) Set ¶
func (api *API) Set(p params.ServiceSet) error
Set implements the server side of Service.Set. It does not unset values that are set to an empty string. Unset should be used for that.
func (*API) SetCharm ¶
func (api *API) SetCharm(args params.ServiceSetCharm) error
SetCharm sets the charm for a given service.
func (*API) SetConstraints ¶
func (api *API) SetConstraints(args params.SetConstraints) error
SetConstraints sets the constraints for a given service.
func (*API) SetMetricCredentials ¶
func (api *API) SetMetricCredentials(args params.ServiceMetricCredentials) (params.ErrorResults, error)
SetMetricCredentials sets credentials on the service.
func (*API) Unexpose ¶
func (api *API) Unexpose(args params.ServiceUnexpose) error
Unexpose changes the juju-managed firewall to unexpose any ports that were also explicitly marked by units as open.
type CharmArchive ¶
type CharmArchive struct { // ID is the charm URL for which we're storing the archive. ID *charm.URL // Charm is the metadata about the charm for the archive. Charm charm.Charm // Data contains the bytes of the archive. Data io.Reader // Size is the number of bytes in Data. Size int64 // SHA256 is the hash of the bytes in Data. SHA256 string // Macaroon is the authorization macaroon for accessing the charmstore. Macaroon macaroon.Slice }
CharmArchive is the data that needs to be stored for a charm archive in state.
type Service ¶
type Service interface {
SetMetricCredentials(args params.ServiceMetricCredentials) (params.ErrorResults, error)
}
Service defines the methods on the service API end point.