applicationoffers

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

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

Go to latest
Published: Feb 15, 2019 License: AGPL-3.0 Imports: 19 Imported by: 0

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

This section is empty.

Types

type Backend

type Backend interface {
	commoncrossmodel.Backend
	Charm(*charm.URL) (commoncrossmodel.Charm, error)
	ApplicationOffer(name string) (*crossmodel.ApplicationOffer, error)
	Model() (Model, error)
	OfferConnections(string) ([]OfferConnection, error)
	Space(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)
}

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 OffersAPI

type OffersAPI struct {
	BaseAPI
	// contains filtered or unexported fields
}

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

func NewOffersAPI

func NewOffersAPI(ctx facade.Context) (*OffersAPI, error)

NewOffersAPIV2 returns a new application offers OffersAPIV2 facade.

func (*OffersAPI) ApplicationOffers

func (api *OffersAPI) ApplicationOffers(urls params.OfferURLs) (params.ApplicationOffersResults, error)

ApplicationOffers gets details about remote applications that match given URLs.

func (*OffersAPI) DestroyOffers

func (api *OffersAPI) DestroyOffers(args params.DestroyApplicationOffers) (params.ErrorResults, error)

DestroyOffers removes the offers specified by the given URLs.

func (*OffersAPI) FindApplicationOffers

func (api *OffersAPI) FindApplicationOffers(filters params.OfferFilters) (params.QueryApplicationOffersResults, error)

FindApplicationOffers gets details about remote applications that match given filter.

func (*OffersAPI) GetConsumeDetails

func (api *OffersAPI) GetConsumeDetails(args params.OfferURLs) (params.ConsumeOfferDetailsResults, error)

GetConsumeDetails returns the details necessary to pass to another model to consume the specified offers represented by the urls.

func (*OffersAPI) ListApplicationOffers

func (api *OffersAPI) ListApplicationOffers(filters params.OfferFilters) (params.QueryApplicationOffersResults, 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 (*OffersAPI) ModifyOfferAccess

func (api *OffersAPI) ModifyOfferAccess(args params.ModifyOfferAccessRequest) (result params.ErrorResults, _ error)

ModifyOfferAccess changes the application offer access granted to users.

func (*OffersAPI) Offer

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

func (*OffersAPI) RemoteApplicationInfo

func (api *OffersAPI) RemoteApplicationInfo(args params.OfferURLs) (params.RemoteApplicationInfoResults, error)

RemoteApplicationInfo returns information about the requested remote application.

type OffersAPIV2

type OffersAPIV2 struct {
	*OffersAPI
}

OffersAPIV2 implements the cross model interface V2.

func NewOffersAPIV2

func NewOffersAPIV2(ctx facade.Context) (*OffersAPIV2, error)

NewOffersAPIV2 returns a new application offers OffersAPIV2 facade.

func (*OffersAPIV2) DestroyOffers

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

type Space

type Space interface {
	Name() string
	Subnets() ([]Subnet, 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 Subnet

type Subnet interface {
	CIDR() string
	VLANTag() int
	ProviderId() network.Id
	ProviderNetworkId() network.Id
	AvailabilityZones() []string
}

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