Documentation
¶
Index ¶
- Variables
- func Register(registry facade.FacadeRegistry)
- type AccessService
- type ApplicationService
- type Backend
- type BaseAPI
- type Model
- type ModelDomainServices
- type ModelDomainServicesGetter
- type OfferConnection
- type OffersAPIv5
- func (api *OffersAPIv5) ApplicationOffers(ctx context.Context, urls params.OfferURLs) (params.ApplicationOffersResults, error)
- func (api *OffersAPIv5) DestroyOffers(ctx context.Context, args params.DestroyApplicationOffers) (params.ErrorResults, error)
- func (api *OffersAPIv5) FindApplicationOffers(ctx context.Context, filters params.OfferFilters) (params.QueryApplicationOffersResultsV5, error)
- func (api *OffersAPIv5) GetConsumeDetails(ctx context.Context, args params.ConsumeOfferDetailsArg) (params.ConsumeOfferDetailsResults, error)
- func (api *OffersAPIv5) ListApplicationOffers(ctx context.Context, filters params.OfferFilters) (params.QueryApplicationOffersResultsV5, error)
- func (api *OffersAPIv5) ModifyOfferAccess(ctx context.Context, args params.ModifyOfferAccessRequest) (result params.ErrorResults, _ error)
- func (api *OffersAPIv5) Offer(ctx context.Context, all params.AddApplicationOffers) (params.ErrorResults, error)
- func (api *OffersAPIv5) RemoteApplicationInfo(ctx context.Context, args params.OfferURLs) (params.RemoteApplicationInfoResults, error)
- type StatePool
Constants ¶
This section is empty.
Variables ¶
var GetApplicationOffers = func(backend interface{}) crossmodel.ApplicationOffers { switch st := backend.(type) { case *state.State: return state.NewApplicationOffers(st) case *stateShim: return state.NewApplicationOffers(st.st) } return nil }
var GetStateAccess = func(st *state.State) Backend { return &stateShim{ st: st, Backend: commoncrossmodel.GetBackend(st), } }
var GetStatePool = func(sp *state.StatePool) StatePool {
return &statePoolShim{sp}
}
Functions ¶
func Register ¶
func Register(registry facade.FacadeRegistry)
Register is called to expose a package of facades onto a given registry.
Types ¶
type AccessService ¶
type AccessService interface { // ReadUserAccessLevelForTarget returns the subject's (user) access level // for the given user on the given target. // If the access level of a user cannot be found then // [accesserrors.AccessNotFound] is returned. ReadUserAccessLevelForTarget(ctx context.Context, subject user.Name, target corepermission.ID) (corepermission.Access, error) // ReadAllUserAccessForTarget return a slice of user access for all users // with access to the given target. // If not user access can be found on the target it will return // [accesserrors.PermissionNotFound]. ReadAllUserAccessForTarget(ctx context.Context, target corepermission.ID) ([]corepermission.UserAccess, error) // CreatePermission gives the user access per the provided spec. // If the user provided does not exist or is marked removed, // [accesserrors.PermissionNotFound] is returned. // If the user provided exists but is marked disabled, // [accesserrors.UserAuthenticationDisabled] is returned. // If a permission for the user and target key already exists, // [accesserrors.PermissionAlreadyExists] is returned. CreatePermission(ctx context.Context, spec corepermission.UserAccessSpec) (corepermission.UserAccess, error) // UpdatePermission updates the permission on the target for the given subject // (user). If the subject is an external user, and they do not exist, they are // created. Access can be granted or revoked. Revoking Read access will delete // the permission. UpdatePermission(ctx context.Context, args access.UpdatePermissionArgs) error // DeletePermission removes the given user's access to the given target. // A NotValid error is returned if the subject (user) string is empty, or // the target is not valid. DeletePermission(ctx context.Context, subject user.Name, target corepermission.ID) error // GetUserByName will retrieve the user specified by name from the database. // If the user does not exist an error that satisfies // accesserrors.UserNotFound will be returned. GetUserByName(ctx context.Context, name user.Name) (user.User, error) }
AccessService provides information about users and permissions.
type ApplicationService ¶
type ApplicationService interface { // GetCharmLocatorByApplicationName returns a CharmLocator by application name. // It returns an error if the charm can not be found by the name. This can also // be used as a cheap way to see if a charm exists without needing to load the // charm metadata. GetCharmLocatorByApplicationName(ctx context.Context, name string) (applicationcharm.CharmLocator, error) // GetCharmMetadataDescription returns the description for the charm using the // charm name, source and revision. GetCharmMetadataDescription(ctx context.Context, locator applicationcharm.CharmLocator) (string, error) }
type Backend ¶
type Backend interface { commoncrossmodel.Backend ApplicationOffer(name string) (*crossmodel.ApplicationOffer, error) Model() (Model, error) OfferConnections(string) ([]OfferConnection, error) }
Backend provides selected methods off the state.State struct.
type BaseAPI ¶
type BaseAPI struct { Authorizer facade.Authorizer GetApplicationOffers func(interface{}) jujucrossmodel.ApplicationOffers ControllerModel Backend StatePool StatePool // contains filtered or unexported fields }
BaseAPI provides various boilerplate methods used by the facade business logic.
type ModelDomainServices ¶
type ModelDomainServices interface {
Application() ApplicationService
}
ModelDomainServices is an interface that provides a way to get model scoped services.
type ModelDomainServicesGetter ¶
type ModelDomainServicesGetter interface {
DomainServicesForModel(ctx context.Context, modelUUID model.UUID) (ModelDomainServices, error)
}
ModelDomainServicesGetter is an interface that provides a way to get a ModelDomainServices based on a model UUID.
type OfferConnection ¶
type OffersAPIv5 ¶
type OffersAPIv5 struct { BaseAPI // contains filtered or unexported fields }
OffersAPIv5 implements the cross model interface and is the concrete implementation of the api end point.
func (*OffersAPIv5) ApplicationOffers ¶
func (api *OffersAPIv5) ApplicationOffers(ctx context.Context, urls params.OfferURLs) (params.ApplicationOffersResults, error)
ApplicationOffers gets details about remote applications that match given URLs.
func (*OffersAPIv5) DestroyOffers ¶
func (api *OffersAPIv5) DestroyOffers(ctx context.Context, args params.DestroyApplicationOffers) (params.ErrorResults, error)
DestroyOffers removes the offers specified by the given URLs, forcing if necessary.
func (*OffersAPIv5) FindApplicationOffers ¶
func (api *OffersAPIv5) FindApplicationOffers(ctx context.Context, filters params.OfferFilters) (params.QueryApplicationOffersResultsV5, error)
FindApplicationOffers gets details about remote applications that match given filter.
func (*OffersAPIv5) GetConsumeDetails ¶
func (api *OffersAPIv5) GetConsumeDetails(ctx context.Context, args params.ConsumeOfferDetailsArg) (params.ConsumeOfferDetailsResults, error)
GetConsumeDetails returns the details necessary to pass to another model to allow the specified args user to consume the offers represented by the args URLs.
func (*OffersAPIv5) ListApplicationOffers ¶
func (api *OffersAPIv5) ListApplicationOffers(ctx context.Context, filters params.OfferFilters) (params.QueryApplicationOffersResultsV5, error)
ListApplicationOffers gets deployed details about application offers that match given filter. The results contain details about the deployed applications such as connection count.
func (*OffersAPIv5) ModifyOfferAccess ¶
func (api *OffersAPIv5) ModifyOfferAccess(ctx context.Context, args params.ModifyOfferAccessRequest) (result params.ErrorResults, _ error)
ModifyOfferAccess changes the application offer access granted to users.
func (*OffersAPIv5) Offer ¶
func (api *OffersAPIv5) Offer(ctx context.Context, all params.AddApplicationOffers) (params.ErrorResults, error)
Offer makes application endpoints available for consumption at a specified URL.
func (*OffersAPIv5) RemoteApplicationInfo ¶
func (api *OffersAPIv5) RemoteApplicationInfo(ctx context.Context, args params.OfferURLs) (params.RemoteApplicationInfoResults, error)
RemoteApplicationInfo returns information about the requested remote application. This call currently has no client side API, only there for the Dashboard at this stage.