applicationoffers

package
v0.0.0-...-298751d Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: AGPL-3.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
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
}
View Source
var GetStateAccess = func(st *state.State) Backend {
	return &stateShim{
		st:      st,
		Backend: commoncrossmodel.GetBackend(st),
	}
}
View Source
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 Backend

type Backend interface {
	commoncrossmodel.Backend
	Charm(string) (commoncrossmodel.Charm, error)
	ApplicationOffer(name string) (*crossmodel.ApplicationOffer, error)
	Model() (Model, error)
	OfferConnections(string) ([]OfferConnection, error)
	SpaceByName(string) (Space, error)
	User(names.UserTag) (User, error)

	CreateOfferAccess(offer names.ApplicationOfferTag, user names.UserTag, access permission.Access) error
	UpdateOfferAccess(offer names.ApplicationOfferTag, user names.UserTag, access permission.Access) error
	RemoveOfferAccess(offer names.ApplicationOfferTag, user names.UserTag) error
	GetOfferUsers(offerUUID string) (map[string]permission.Access, error)

	// GetModelCallContext gets everything that is needed to make cloud calls on behalf of the state current model.
	GetModelCallContext() context.ProviderCallContext

	AllSpaceInfos() (network.SpaceInfos, 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 Model

type Model interface {
	UUID() string
	ModelTag() names.ModelTag
	Name() string
	Type() state.ModelType
	Owner() names.UserTag
}

type OfferConnection

type OfferConnection interface {
	SourceModelUUID() string
	UserName() string
	RelationKey() string
	RelationId() int
}

type OffersAPIv4

type OffersAPIv4 struct {
	OffersAPIv5
}

OffersAPIv4 implements the cross model interface and is the concrete implementation of the api end point.

func (*OffersAPIv4) ListApplicationOffers

func (api *OffersAPIv4) ListApplicationOffers(filters params.OfferFilters) (params.QueryApplicationOffersResultsV4, error)

ListApplicationOffers gets deployed details about application offers that match given filter. The results contain details about the deployed applications such as connection count.

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(urls params.OfferURLs) (params.ApplicationOffersResults, error)

ApplicationOffers gets details about remote applications that match given URLs.

func (*OffersAPIv5) DestroyOffers

DestroyOffers removes the offers specified by the given URLs, forcing if necessary.

func (*OffersAPIv5) FindApplicationOffers

func (api *OffersAPIv5) FindApplicationOffers(filters params.OfferFilters) (params.QueryApplicationOffersResultsV5, error)

FindApplicationOffers gets details about remote applications that match given filter.

func (*OffersAPIv5) GetConsumeDetails

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(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(args params.ModifyOfferAccessRequest) (result params.ErrorResults, _ error)

ModifyOfferAccess changes the application offer access granted to users.

func (*OffersAPIv5) Offer

Offer makes application endpoints available for consumption at a specified URL.

func (*OffersAPIv5) RemoteApplicationInfo

func (api *OffersAPIv5) RemoteApplicationInfo(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.

type Space

type Space interface {
	Name() string
	NetworkSpace() (network.SpaceInfo, error)
	ProviderId() network.Id
}

type StatePool

type StatePool interface {
	// Get returns a State for a given model from the pool.
	Get(modelUUID string) (Backend, func(), error)

	// Get returns a Model from the pool.
	GetModel(modelUUID string) (Model, func(), error)
}

StatePool provides the subset of a state pool.

type User

type User interface {
	DisplayName() string
}

Jump to

Keyboard shortcuts

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