crossmodelrelations

package
v0.0.0-...-f88c608 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: AGPL-3.0 Imports: 34 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(registry facade.FacadeRegistry)

Register is called to expose a package of facades onto a given registry.

Types

type ApplicationService

type ApplicationService interface {
	// GetApplicationDisplayStatus returns the display status of the specified application.
	// The display status is equal to the application status if it is set, otherwise it is
	// derived from the unit display statuses.
	// If no application is found, an error satisfying [applicationerrors.ApplicationNotFound]
	// is returned.
	GetApplicationDisplayStatus(context.Context, application.ID) (*status.StatusInfo, error)

	// GetApplicationIDByName returns an application ID by application name. It
	// returns an error if the application can not be found by the name.
	//
	// Returns [applicationerrors.ApplicationNotFound] if the application is not found.
	GetApplicationIDByName(context.Context, string) (application.ID, error)
}

type CrossModelRelationsAPIv3

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

CrossModelRelationsAPIv3 provides access to the CrossModelRelations API facade.

func NewCrossModelRelationsAPI

func NewCrossModelRelationsAPI(
	modelID model.UUID,
	st CrossModelRelationsState,
	fw firewall.State,
	resources facade.Resources,
	authorizer facade.Authorizer,
	authCtxt *commoncrossmodel.AuthContext,
	secretService SecretService,
	modelConfigService ModelConfigService,
	applicationService ApplicationService,
	egressAddressWatcher egressAddressWatcherFunc,
	relationStatusWatcher relationStatusWatcherFunc,
	offerStatusWatcher offerStatusWatcherFunc,
	consumedSecretsWatcher consumedSecretsWatcherFunc,
	logger logger.Logger,
) (*CrossModelRelationsAPIv3, error)

NewCrossModelRelationsAPI returns a new server-side CrossModelRelationsAPI facade.

func (*CrossModelRelationsAPIv3) PublishIngressNetworkChanges

func (api *CrossModelRelationsAPIv3) PublishIngressNetworkChanges(
	ctx context.Context,
	changes params.IngressNetworksChanges,
) (params.ErrorResults, error)

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

func (*CrossModelRelationsAPIv3) PublishRelationChanges

func (api *CrossModelRelationsAPIv3) PublishRelationChanges(
	ctx context.Context,
	changes params.RemoteRelationsChanges,
) (params.ErrorResults, error)

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

func (*CrossModelRelationsAPIv3) RegisterRemoteRelations

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

func (*CrossModelRelationsAPIv3) WatchConsumedSecretsChanges

WatchConsumedSecretsChanges returns a watcher which notifies of changes to any secrets for the specified remote consumers.

func (*CrossModelRelationsAPIv3) WatchEgressAddressesForRelations

func (api *CrossModelRelationsAPIv3) WatchEgressAddressesForRelations(ctx context.Context, 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 (*CrossModelRelationsAPIv3) WatchOfferStatus

func (api *CrossModelRelationsAPIv3) WatchOfferStatus(
	ctx context.Context,
	offerArgs params.OfferArgs,
) (params.OfferStatusWatchResults, error)

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

func (*CrossModelRelationsAPIv3) WatchRelationChanges

func (api *CrossModelRelationsAPIv3) WatchRelationChanges(ctx context.Context, 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 (*CrossModelRelationsAPIv3) WatchRelationsSuspendedStatus

func (api *CrossModelRelationsAPIv3) WatchRelationsSuspendedStatus(
	ctx context.Context,
	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) (common.OfferConnection, error)

	// IsMigrationActive returns true if the current model is
	// in the process of being migrated to another controller.
	IsMigrationActive() (bool, error)
}

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

type Model

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

type ModelConfigService

type ModelConfigService interface {
	ModelConfig(ctx context.Context) (*config.Config, error)
	Watch() (watcher.StringsWatcher, error)
}

ModelConfigService is an interface that provides access to the model configuration.

type OfferWatcher

type OfferWatcher interface {
	Err() error
	corewatcher.NotifyWatcher
	OfferUUID() string
	OfferName() string
}

OfferWatcher instances track changes to a specified offer.

type SecretService

type SecretService interface {
	GetSecret(ctx context.Context, uri *secrets.URI) (*secrets.SecretMetadata, error)
	WatchRemoteConsumedSecretsChanges(ctx context.Context, appName string) (watcher.StringsWatcher, error)
}

Jump to

Keyboard shortcuts

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