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

package crossmodelrelations

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

Index

Package Files

crossmodelrelations.go state.go

type CrossModelRelationsAPI Uses

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

CrossModelRelationsAPI provides access to the CrossModelRelations API facade.

func NewCrossModelRelationsAPI Uses

func NewCrossModelRelationsAPI(
    st CrossModelRelationsState,
    fw firewall.State,
    resources facade.Resources,
    authorizer facade.Authorizer,
    authCtxt *commoncrossmodel.AuthContext,
    egressAddressWatcher egressAddressWatcherFunc,
    relationStatusWatcher relationStatusWatcherFunc,
    offerStatusWatcher offerStatusWatcherFunc,
) (*CrossModelRelationsAPI, error)

NewCrossModelRelationsAPI returns a new server-side CrossModelRelationsAPI facade.

func NewStateCrossModelRelationsAPI Uses

func NewStateCrossModelRelationsAPI(ctx facade.Context) (*CrossModelRelationsAPI, error)

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

func (*CrossModelRelationsAPI) PublishIngressNetworkChanges Uses

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 Uses

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 Uses

func (api *CrossModelRelationsAPI) RegisterRemoteRelations(
    relations params.RegisterRemoteRelationArgs,
) (params.RegisterRemoteRelationResults, error)

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

func (*CrossModelRelationsAPI) WatchEgressAddressesForRelations Uses

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 Uses

func (api *CrossModelRelationsAPI) WatchOfferStatus(
    offerArgs params.OfferArgs,
) (params.OfferStatusWatchResults, error)

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

func (*CrossModelRelationsAPI) WatchRelationChanges Uses

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 Uses

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 Uses

type CrossModelRelationsAPIV1 struct {
    *CrossModelRelationsAPI
}

CrossModelRelationsAPIV1 has WatchRelationUnits rather than WatchRelationChanges.

func NewStateCrossModelRelationsAPIV1 Uses

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

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

func (*CrossModelRelationsAPIV1) RelationUnitSettings Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

type OfferConnection Uses

type OfferConnection interface {
    OfferUUID() string
}

type OfferWatcher Uses

type OfferWatcher interface {
    state.NotifyWatcher
    OfferUUID() string
}

OfferWatcher instances track changes to a specified offer.

Package crossmodelrelations imports 18 packages (graph) and is imported by 4 packages. Updated 2020-02-24. Refresh now. Tools for package owners.