remoterelations

package
v0.0.0-...-0a82276 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: AGPL-3.0 Imports: 20 Imported by: 1

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 API

type API struct {
	ControllerConfigAPI
	// contains filtered or unexported fields
}

API provides access to the remote relations API facade.

func NewRemoteRelationsAPI

func NewRemoteRelationsAPI(
	modelID model.UUID,
	st RemoteRelationsState,
	ecService ExternalControllerService,
	secretService SecretService,
	modelConfigService common.ModelConfigService,
	controllerCfgAPI ControllerConfigAPI,
	resources facade.Resources,
	authorizer facade.Authorizer,
	logger corelogger.Logger,
) (*API, error)

NewRemoteRelationsAPI returns a new server-side API facade.

func (*API) ConsumeRemoteRelationChanges

func (api *API) ConsumeRemoteRelationChanges(ctx context.Context, changes params.RemoteRelationsChanges) (params.ErrorResults, error)

ConsumeRemoteRelationChanges consumes changes to settings originating from the remote/offering side of relations.

func (*API) ConsumeRemoteSecretChanges

func (api *API) ConsumeRemoteSecretChanges(ctx context.Context, args params.LatestSecretRevisionChanges) (params.ErrorResults, error)

ConsumeRemoteSecretChanges updates the local model with secret revision changes originating from the remote/offering model.

func (*API) ExportEntities

func (api *API) ExportEntities(ctx context.Context, entities params.Entities) (params.TokenResults, error)

ExportEntities allocates unique, remote entity IDs for the given entities in the local model.

func (*API) GetTokens

func (api *API) GetTokens(ctx context.Context, args params.GetTokenArgs) (params.StringResults, error)

GetTokens returns the token associated with the entities with the given tags for the given models.

func (*API) ImportRemoteEntities

func (api *API) ImportRemoteEntities(ctx context.Context, args params.RemoteEntityTokenArgs) (params.ErrorResults, error)

ImportRemoteEntities adds entities to the remote entities collection with the specified opaque tokens.

func (*API) Relations

func (api *API) Relations(ctx context.Context, entities params.Entities) (params.RemoteRelationResults, error)

Relations returns information about the cross-model relations with the specified keys in the local model.

func (*API) RemoteApplications

func (api *API) RemoteApplications(ctx context.Context, entities params.Entities) (params.RemoteApplicationResults, error)

RemoteApplications returns the current state of the remote applications with the specified names in the local model.

func (*API) SaveMacaroons

func (api *API) SaveMacaroons(ctx context.Context, args params.EntityMacaroonArgs) (params.ErrorResults, error)

SaveMacaroons saves the macaroons for the given entities.

func (*API) SetRemoteApplicationsStatus

func (api *API) SetRemoteApplicationsStatus(ctx context.Context, args params.SetStatus) (params.ErrorResults, error)

SetRemoteApplicationsStatus sets the status for the specified remote applications.

func (*API) UpdateControllersForModels

func (api *API) UpdateControllersForModels(ctx context.Context, args params.UpdateControllersForModelsParams) (params.ErrorResults, error)

UpdateControllersForModels changes the external controller records for the associated model entities. This is used when the remote relations worker gets redirected following migration of an offering model.

func (*API) WatchLocalRelationChanges

func (api *API) WatchLocalRelationChanges(ctx context.Context, args params.Entities) (params.RemoteRelationWatchResults, error)

WatchLocalRelationChanges starts a RemoteRelationWatcher for each specified relation, returning the watcher IDs and initial values, or an error if the remote relations couldn't be watched.

func (*API) WatchRemoteApplicationRelations

func (api *API) WatchRemoteApplicationRelations(ctx context.Context, args params.Entities) (params.StringsWatchResults, error)

WatchRemoteApplicationRelations starts a StringsWatcher for watching the relations of each specified application in the local model, and returns the watcher IDs and initial values, or an error if the services' relations could not be watched.

func (*API) WatchRemoteApplications

func (api *API) WatchRemoteApplications(ctx context.Context) (params.StringsWatchResult, error)

WatchRemoteApplications starts a strings watcher that notifies of the addition, removal, and lifecycle changes of remote applications in the model; and returns the watcher ID and initial IDs of remote applications, or an error if watching failed.

func (*API) WatchRemoteRelations

func (api *API) WatchRemoteRelations(ctx context.Context) (params.StringsWatchResult, error)

WatchRemoteRelations starts a strings watcher that notifies of the addition, removal, and lifecycle changes of remote relations in the model; and returns the watcher ID and initial IDs of remote relations, or an error if watching failed.

type ControllerConfigAPI

type ControllerConfigAPI interface {
	// ControllerConfig returns the controller's configuration.
	ControllerConfig(context.Context) (params.ControllerConfigResult, error)

	// ControllerAPIInfoForModels returns the controller api connection details for the specified models.
	ControllerAPIInfoForModels(ctx context.Context, args params.Entities) (params.ControllerAPIInfoResults, error)
}

ControllerConfigAPI provides the subset of common.ControllerConfigAPI required by the remote firewaller facade

type ExternalControllerService

type ExternalControllerService interface {
	// UpdateExternalController persists the input controller
	// record and associates it with the input model UUIDs.
	UpdateExternalController(ctx context.Context, ec crossmodel.ControllerInfo) error
}

ExternalControllerService provides a subset of the external controller domain service methods.

type RemoteRelationsState

type RemoteRelationsState interface {
	common.Backend

	// WatchRemoteApplications returns a StringsWatcher that notifies of changes to
	// the lifecycles of the remote applications in the model.
	WatchRemoteApplications() state.StringsWatcher

	// WatchRemoteApplicationRelations returns a StringsWatcher that notifies of
	// changes to the life-cycles of relations involving the specified remote
	// application.
	WatchRemoteApplicationRelations(applicationName string) (state.StringsWatcher, error)

	// WatchRemoteRelations returns a StringsWatcher that notifies of changes to
	// the lifecycles of remote relations in the model.
	WatchRemoteRelations() state.StringsWatcher

	// RemoveRemoteEntity removes the specified entity from the remote entities collection.
	RemoveRemoteEntity(entity names.Tag) error

	// SaveMacaroon saves the given macaroon for the specified entity.
	SaveMacaroon(entity names.Tag, mac *macaroon.Macaroon) error
}

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

type SecretService

type SecretService interface {
	UpdateRemoteSecretRevision(ctx context.Context, uri *secrets.URI, latestRevision int) error
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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