juju: github.com/juju/juju/apiserver/facades/controller/remoterelations Index | Files

package remoterelations

import "github.com/juju/juju/apiserver/facades/controller/remoterelations"

Index

Package Files

remoterelations.go state.go

type API Uses

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

API provides access to the remote relations API facade.

func NewAPI Uses

func NewAPI(ctx facade.Context) (*API, error)

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

func NewRemoteRelationsAPI Uses

func NewRemoteRelationsAPI(
    st RemoteRelationsState,
    controllerCfgAPI *common.ControllerConfigAPI,
    resources facade.Resources,
    authorizer facade.Authorizer,
) (*API, error)

NewRemoteRelationsAPI returns a new server-side API facade.

func (*API) ConsumeRemoteRelationChanges Uses

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) ExportEntities Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

SaveMacaroons saves the macaroons for the given entities.

func (*API) SetRemoteApplicationsStatus Uses

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

SetRemoteApplicationsStatus sets the status for the specified remote applications.

func (*API) UpdateControllersForModels Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 APIv1 Uses

type APIv1 struct {
    *API
}

API provides access to version 1 of the remote relations API facade.

func NewAPIv1 Uses

func NewAPIv1(ctx facade.Context) (*APIv1, error)

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

func (*APIv1) RelationUnitSettings Uses

func (api *APIv1) RelationUnitSettings(relationUnits params.RelationUnits) (params.SettingsResults, error)

RelationUnitSettings returns the relation unit settings for the given relation units in the local model. (Removed in v2 of the API - the settings are included in the events from WatchLocalRelationChanges.)

func (*APIv1) UpdateControllersForModels Uses

func (u *APIv1) UpdateControllersForModels(_, _ struct{})

UpdateControllersForModels is not available via the V1 API.

func (*APIv1) WatchLocalRelationChanges Uses

func (api *APIv1) WatchLocalRelationChanges(_, _ 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.

WatchLocalRelationChanges doesn't exist before the v2 API.

func (*APIv1) WatchLocalRelationUnits Uses

func (api *APIv1) WatchLocalRelationUnits(args params.Entities) (params.RelationUnitsWatchResults, error)

WatchLocalRelationUnits starts a RelationUnitsWatcher for watching the local relation units involved in each specified relation in the local model, and returns the watcher IDs and initial values, or an error if the relation units could not be watched. WatchLocalRelationUnits is only supported on the v1 API - later versions provide WatchLocalRelationChanges instead.

type RemoteRelationsState Uses

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
}

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

Package remoterelations imports 13 packages (graph) and is imported by 4 packages. Updated 2020-09-24. Refresh now. Tools for package owners.