remoterelations

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

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

Go to latest
Published: Apr 25, 2024 License: AGPL-3.0 Imports: 15 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(
	st RemoteRelationsState,
	controllerCfgAPI ControllerConfigAPI,
	resources facade.Resources,
	authorizer facade.Authorizer,
) (*API, error)

NewRemoteRelationsAPI returns a new server-side API facade.

func (*API) ConsumeRemoteRelationChanges

func (api *API) ConsumeRemoteRelationChanges(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(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(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(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(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(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(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(args params.EntityMacaroonArgs) (params.ErrorResults, error)

SaveMacaroons saves the macaroons for the given entities.

func (*API) SetRemoteApplicationsStatus

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

SetRemoteApplicationsStatus sets the status for the specified remote applications.

func (*API) UpdateControllersForModels

func (api *API) UpdateControllersForModels(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(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(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() (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() (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() (params.ControllerConfigResult, error)

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

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

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

	// UpdateControllerForModel ensures that there is an external controller
	// record for the input info, associated with the input model ID.
	UpdateControllerForModel(controller crossmodel.ControllerInfo, modelUUID string) error
}

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

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