Documentation ¶
Overview ¶
The uniter package implements the API interface used by the uniter worker.
Index ¶
- type UniterAPI
- func (u *UniterAPI) CharmArchiveSha256(args params.CharmURLs) (params.StringResults, error)
- func (u *UniterAPI) CharmArchiveURL(args params.CharmURLs) (params.CharmArchiveURLResults, error)
- func (u *UniterAPI) CharmURL(args params.Entities) (params.StringBoolResults, error)
- func (u *UniterAPI) ClearResolved(args params.Entities) (params.ErrorResults, error)
- func (u *UniterAPI) ClosePort(args params.EntitiesPorts) (params.ErrorResults, error)
- func (u *UniterAPI) ConfigSettings(args params.Entities) (params.ConfigSettingsResults, error)
- func (u *UniterAPI) CurrentEnvironUUID() (params.StringResult, error)
- func (u *UniterAPI) CurrentEnvironment() (params.EnvironmentResult, error)
- func (u *UniterAPI) Destroy(args params.Entities) (params.ErrorResults, error)
- func (u *UniterAPI) DestroyAllSubordinates(args params.Entities) (params.ErrorResults, error)
- func (u *UniterAPI) EnterScope(args params.RelationUnits) (params.ErrorResults, error)
- func (u *UniterAPI) GetOwnerTag(args params.Entities) (params.StringResult, error)
- func (u *UniterAPI) GetPrincipal(args params.Entities) (params.StringBoolResults, error)
- func (u *UniterAPI) HasSubordinates(args params.Entities) (params.BoolResults, error)
- func (u *UniterAPI) JoinedRelations(args params.Entities) (params.StringsResults, error)
- func (u *UniterAPI) LeaveScope(args params.RelationUnits) (params.ErrorResults, error)
- func (u *UniterAPI) OpenPort(args params.EntitiesPorts) (params.ErrorResults, error)
- func (u *UniterAPI) PrivateAddress(args params.Entities) (params.StringResults, error)
- func (u *UniterAPI) ProviderType() (params.StringResult, error)
- func (u *UniterAPI) PublicAddress(args params.Entities) (params.StringResults, error)
- func (u *UniterAPI) ReadRemoteSettings(args params.RelationUnitPairs) (params.RelationSettingsResults, error)
- func (u *UniterAPI) ReadSettings(args params.RelationUnits) (params.RelationSettingsResults, error)
- func (u *UniterAPI) Relation(args params.RelationUnits) (params.RelationResults, error)
- func (u *UniterAPI) RelationById(args params.RelationIds) (params.RelationResults, error)
- func (u *UniterAPI) Resolved(args params.Entities) (params.ResolvedModeResults, error)
- func (u *UniterAPI) SetCharmURL(args params.EntitiesCharmURL) (params.ErrorResults, error)
- func (u *UniterAPI) UpdateSettings(args params.RelationUnitsSettings) (params.ErrorResults, error)
- func (u *UniterAPI) WatchConfigSettings(args params.Entities) (params.NotifyWatchResults, error)
- func (u *UniterAPI) WatchRelationUnits(args params.RelationUnits) (params.RelationUnitsWatchResults, error)
- func (u *UniterAPI) WatchServiceRelations(args params.Entities) (params.StringsWatchResults, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UniterAPI ¶
type UniterAPI struct { *common.LifeGetter *common.StatusSetter *common.DeadEnsurer *common.AgentEntityWatcher *common.APIAddresser *common.EnvironWatcher // contains filtered or unexported fields }
UniterAPI implements the API used by the uniter worker.
func NewUniterAPI ¶
func NewUniterAPI(st *state.State, resources *common.Resources, authorizer common.Authorizer) (*UniterAPI, error)
NewUniterAPI creates a new instance of the Uniter API.
func (*UniterAPI) CharmArchiveSha256 ¶
CharmArchiveSha256 returns the SHA256 digest of the charm archive (bundle) data for each charm url in the given parameters.
func (*UniterAPI) CharmArchiveURL ¶
CharmArchiveURL returns the URL, corresponding to the charm archive (bundle) in the provider storage for each given charm URL, along with the DisableSSLHostnameVerification flag.
func (*UniterAPI) ClearResolved ¶
ClearResolved removes any resolved setting from each given unit.
func (*UniterAPI) ClosePort ¶
func (u *UniterAPI) ClosePort(args params.EntitiesPorts) (params.ErrorResults, error)
ClosePort sets the policy of the port with protocol and number to be closed, for all given units.
func (*UniterAPI) ConfigSettings ¶
ConfigSettings returns the complete set of service charm config settings available to each given unit.
func (*UniterAPI) CurrentEnvironUUID ¶
func (u *UniterAPI) CurrentEnvironUUID() (params.StringResult, error)
CurrentEnvironUUID returns the UUID for the current juju environment.
func (*UniterAPI) CurrentEnvironment ¶
func (u *UniterAPI) CurrentEnvironment() (params.EnvironmentResult, error)
CurrentEnvironment returns the name and UUID for the current juju environment.
func (*UniterAPI) Destroy ¶
Destroy advances all given Alive units' lifecycles as far as possible. See state/Unit.Destroy().
func (*UniterAPI) DestroyAllSubordinates ¶
DestroyAllSubordinates destroys all subordinates of each given unit.
func (*UniterAPI) EnterScope ¶
func (u *UniterAPI) EnterScope(args params.RelationUnits) (params.ErrorResults, error)
EnterScope ensures each unit has entered its scope in the relation, for all of the given relation/unit pairs. See also state.RelationUnit.EnterScope().
func (*UniterAPI) GetOwnerTag ¶
TODO(dimitern) bug #1270795 2014-01-20 Add a doc comment here and use u.accessService() below in the body to check for permissions.
func (*UniterAPI) GetPrincipal ¶
GetPrincipal returns the result of calling PrincipalName() and converting it to a tag, on each given unit.
func (*UniterAPI) HasSubordinates ¶
HasSubordinates returns the whether each given unit has any subordinates.
func (*UniterAPI) JoinedRelations ¶
JoinedRelations returns the tags of all relations for which each supplied unit has entered scope. It should be called RelationsInScope, but it's not convenient to make that change until we have versioned APIs.
func (*UniterAPI) LeaveScope ¶
func (u *UniterAPI) LeaveScope(args params.RelationUnits) (params.ErrorResults, error)
LeaveScope signals each unit has left its scope in the relation, for all of the given relation/unit pairs. See also state.RelationUnit.LeaveScope().
func (*UniterAPI) OpenPort ¶
func (u *UniterAPI) OpenPort(args params.EntitiesPorts) (params.ErrorResults, error)
OpenPort sets the policy of the port with protocol an number to be opened, for all given units.
func (*UniterAPI) PrivateAddress ¶
PrivateAddress returns the private address for each given unit, if set.
func (*UniterAPI) ProviderType ¶
func (u *UniterAPI) ProviderType() (params.StringResult, error)
ProviderType returns the provider type used by the current juju environment.
TODO(dimitern): Refactor the uniter to call this instead of calling EnvironConfig() just to get the provider type. Once we have machine addresses, this might be completely unnecessary though.
func (*UniterAPI) PublicAddress ¶
PublicAddress returns the public address for each given unit, if set.
func (*UniterAPI) ReadRemoteSettings ¶
func (u *UniterAPI) ReadRemoteSettings(args params.RelationUnitPairs) (params.RelationSettingsResults, error)
ReadRemoteSettings returns the remote settings of each given set of relation/local unit/remote unit.
func (*UniterAPI) ReadSettings ¶
func (u *UniterAPI) ReadSettings(args params.RelationUnits) (params.RelationSettingsResults, error)
ReadSettings returns the local settings of each given set of relation/unit.
func (*UniterAPI) Relation ¶
func (u *UniterAPI) Relation(args params.RelationUnits) (params.RelationResults, error)
Relation returns information about all given relation/unit pairs, including their id, key and the local endpoint.
func (*UniterAPI) RelationById ¶
func (u *UniterAPI) RelationById(args params.RelationIds) (params.RelationResults, error)
RelationById returns information about all given relations, specified by their ids, including their key and the local endpoint.
func (*UniterAPI) SetCharmURL ¶
func (u *UniterAPI) SetCharmURL(args params.EntitiesCharmURL) (params.ErrorResults, error)
SetCharmURL sets the charm URL for each given unit. An error will be returned if a unit is dead, or the charm URL is not know.
func (*UniterAPI) UpdateSettings ¶
func (u *UniterAPI) UpdateSettings(args params.RelationUnitsSettings) (params.ErrorResults, error)
UpdateSettings persists all changes made to the local settings of all given pairs of relation and unit. Keys with empty values are considered a signal to delete these values.
func (*UniterAPI) WatchConfigSettings ¶
WatchConfigSettings returns a NotifyWatcher for observing changes to each unit's service configuration settings. See also state/watcher.go:Unit.WatchConfigSettings().
func (*UniterAPI) WatchRelationUnits ¶
func (u *UniterAPI) WatchRelationUnits(args params.RelationUnits) (params.RelationUnitsWatchResults, error)
WatchRelationUnits returns a RelationUnitsWatcher for observing changes to every unit in the supplied relation that is visible to the supplied unit. See also state/watcher.go:RelationUnit.Watch().
func (*UniterAPI) WatchServiceRelations ¶
WatchServiceRelations returns a StringsWatcher, for each given service, that notifies of changes to the lifecycles of relations involving that service.