crossmodelrelations

package
v0.0.0-...-8ff1004 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2019 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CrossModelRelationsAPI

type CrossModelRelationsAPI struct {
	// contains filtered or unexported fields
}

CrossModelRelationsAPI provides access to the CrossModelRelations API facade.

func NewCrossModelRelationsAPI

func NewCrossModelRelationsAPI(
	st CrossModelRelationsState,
	fw firewall.State,
	resources facade.Resources,
	authorizer facade.Authorizer,
	authCtxt *commoncrossmodel.AuthContext,
	egressAddressWatcher egressAddressWatcherFunc,
	relationStatusWatcher relationStatusWatcherFunc,
	offerStatusWatcher offerStatusWatcherFunc,
) (*CrossModelRelationsAPI, error)

NewCrossModelRelationsAPI returns a new server-side CrossModelRelationsAPI facade.

func NewStateCrossModelRelationsAPI

func NewStateCrossModelRelationsAPI(ctx facade.Context) (*CrossModelRelationsAPI, error)

NewStateCrossModelRelationsAPI creates a new server-side CrossModelRelations API facade backed by global state.

func (*CrossModelRelationsAPI) PublishIngressNetworkChanges

func (api *CrossModelRelationsAPI) PublishIngressNetworkChanges(
	changes params.IngressNetworksChanges,
) (params.ErrorResults, error)

PublishIngressNetworkChanges publishes changes to the required ingress addresses to the model hosting the offer in the relation.

func (*CrossModelRelationsAPI) PublishRelationChanges

func (api *CrossModelRelationsAPI) PublishRelationChanges(
	changes params.RemoteRelationsChanges,
) (params.ErrorResults, error)

PublishRelationChanges publishes relation changes to the model hosting the remote application involved in the relation.

func (*CrossModelRelationsAPI) RegisterRemoteRelations

RegisterRemoteRelationArgs sets up the model to participate in the specified relations. This operation is idempotent.

func (*CrossModelRelationsAPI) RelationUnitSettings

func (api *CrossModelRelationsAPI) RelationUnitSettings(relationUnits params.RemoteRelationUnits) (params.SettingsResults, error)

RelationUnitSettings returns the relation unit settings for the given relation units.

func (*CrossModelRelationsAPI) WatchEgressAddressesForRelations

func (api *CrossModelRelationsAPI) WatchEgressAddressesForRelations(remoteRelationArgs params.RemoteEntityArgs) (params.StringsWatchResults, error)

WatchEgressAddressesForRelations creates a watcher that notifies when addresses, from which connections will originate for the relation, change. Each event contains the entire set of addresses which are required for ingress for the relation.

func (*CrossModelRelationsAPI) WatchOfferStatus

func (api *CrossModelRelationsAPI) WatchOfferStatus(
	offerArgs params.OfferArgs,
) (params.OfferStatusWatchResults, error)

WatchOfferStatus starts an OfferStatusWatcher for watching the status of an offer.

func (*CrossModelRelationsAPI) WatchRelationUnits

func (api *CrossModelRelationsAPI) WatchRelationUnits(remoteRelationArgs params.RemoteEntityArgs) (params.RelationUnitsWatchResults, error)

WatchRelationUnits starts a RelationUnitsWatcher for watching the relation units involved in each specified relation, and returns the watcher IDs and initial values, or an error if the relation units could not be watched.

func (*CrossModelRelationsAPI) WatchRelationsSuspendedStatus

func (api *CrossModelRelationsAPI) WatchRelationsSuspendedStatus(
	remoteRelationArgs params.RemoteEntityArgs,
) (params.RelationStatusWatchResults, error)

WatchRelationsSuspendedStatus starts a RelationStatusWatcher for watching the life and suspended status of a relation.

type CrossModelRelationsState

type CrossModelRelationsState interface {
	common.Backend

	// Model returns the model entity.
	Model() (Model, error)

	// AddOfferConnection creates a new offer connection record, which records details about a
	// relation made from a remote model to an offer in the local model.
	AddOfferConnection(state.AddOfferConnectionParams) (OfferConnection, error)

	// OfferConnectionForRelation returns the offer connection details for the given relation key.
	OfferConnectionForRelation(string) (OfferConnection, error)
}

RemoteRelationState provides the subset of global state required by the remote relations facade.

type Model

type Model interface {
	Name() string
	Owner() names.UserTag
}

type OfferConnection

type OfferConnection interface {
	OfferUUID() string
}

type OfferWatcher

type OfferWatcher interface {
	state.NotifyWatcher
	OfferUUID() string
}

OfferWatcher instances track changes to a specified offer.

Jump to

Keyboard shortcuts

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