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,
	model commoncrossmodel.CachedModel,
	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) 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) WatchRelationChanges

func (api *CrossModelRelationsAPI) WatchRelationChanges(remoteRelationArgs params.RemoteEntityArgs) (
	params.RemoteRelationWatchResults, error,
)

WatchRelationChanges starts a RemoteRelationChangesWatcher for each specified relation, returning the watcher IDs and initial values, or an error if the remote relations couldn't 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 CrossModelRelationsAPIV1

type CrossModelRelationsAPIV1 struct {
	*CrossModelRelationsAPI
}

CrossModelRelationsAPIV1 has WatchRelationUnits rather than WatchRelationChanges.

func NewStateCrossModelRelationsAPIV1

func NewStateCrossModelRelationsAPIV1(ctx facade.Context) (*CrossModelRelationsAPIV1, error)

NewStateCrossModelRelationsAPIV1 creates a new server-side CrossModelRelations v1 API facade backed by state.

func (*CrossModelRelationsAPIV1) RelationUnitSettings

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

RelationUnitSettings returns the relation unit settings for the given relation units. (Removed in v2 of the API, the events returned by WatchRelationChanges include the full settings.)

func (*CrossModelRelationsAPIV1) WatchRelationChanges

func (api *CrossModelRelationsAPIV1) WatchRelationChanges(_, _ struct{})

Mask out new methods from the old API versions. The API reflection code in rpc/rpcreflect/type.go:newMethod skips 2-argument methods, so this removes the method as far as the RPC machinery is concerned.

WatchRelationChanges doesn't exist before the v2 API.

func (*CrossModelRelationsAPIV1) WatchRelationUnits

func (api *CrossModelRelationsAPIV1) 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. WatchRelationUnits is only supported on the v1 API - later versions provide WatchRelationChanges instead.

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)

	// IsMigrationActive returns true if the current model is
	// in the process of being migrated to another controller.
	IsMigrationActive() (bool, 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
	OfferName() string
}

OfferWatcher instances track changes to a specified offer.