uniter

package
v0.0.0-...-732aecd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2014 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

The uniter package implements the API interface used by the uniter worker.

Index

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

func (u *UniterAPI) CharmArchiveSha256(args params.CharmURLs) (params.StringResults, error)

CharmArchiveSha256 returns the SHA256 digest of the charm archive (bundle) data for each charm url in the given parameters.

func (*UniterAPI) CharmArchiveURL

func (u *UniterAPI) CharmArchiveURL(args params.CharmURLs) (params.CharmArchiveURLResults, error)

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) CharmURL

func (u *UniterAPI) CharmURL(args params.Entities) (params.StringBoolResults, error)

CharmURL returns the charm URL for all given units or services.

func (*UniterAPI) ClearResolved

func (u *UniterAPI) ClearResolved(args params.Entities) (params.ErrorResults, error)

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

func (u *UniterAPI) ConfigSettings(args params.Entities) (params.ConfigSettingsResults, error)

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

func (u *UniterAPI) Destroy(args params.Entities) (params.ErrorResults, error)

Destroy advances all given Alive units' lifecycles as far as possible. See state/Unit.Destroy().

func (*UniterAPI) DestroyAllSubordinates

func (u *UniterAPI) DestroyAllSubordinates(args params.Entities) (params.ErrorResults, error)

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

func (u *UniterAPI) GetOwnerTag(args params.Entities) (params.StringResult, error)

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

func (u *UniterAPI) GetPrincipal(args params.Entities) (params.StringBoolResults, error)

GetPrincipal returns the result of calling PrincipalName() and converting it to a tag, on each given unit.

func (*UniterAPI) HasSubordinates

func (u *UniterAPI) HasSubordinates(args params.Entities) (params.BoolResults, error)

HasSubordinates returns the whether each given unit has any subordinates.

func (*UniterAPI) JoinedRelations

func (u *UniterAPI) JoinedRelations(args params.Entities) (params.StringsResults, error)

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

func (u *UniterAPI) PrivateAddress(args params.Entities) (params.StringResults, error)

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

func (u *UniterAPI) PublicAddress(args params.Entities) (params.StringResults, error)

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

ReadSettings returns the local settings of each given set of relation/unit.

func (*UniterAPI) Relation

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) Resolved

Resolved returns the current resolved setting for each given unit.

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

func (u *UniterAPI) WatchConfigSettings(args params.Entities) (params.NotifyWatchResults, error)

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

func (u *UniterAPI) WatchServiceRelations(args params.Entities) (params.StringsWatchResults, error)

WatchServiceRelations returns a StringsWatcher, for each given service, that notifies of changes to the lifecycles of relations involving that service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL