juju: github.com/juju/juju/apiserver/facades/client/applicationoffers Index | Files

package applicationoffers

import "github.com/juju/juju/apiserver/facades/client/applicationoffers"

Index

Package Files

applicationoffers.go base.go conversions.go state.go

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}

}

type Backend Uses

type Backend interface {
    commoncrossmodel.Backend
    Charm(*charm.URL) (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
}

Backend provides selected methods off the state.State struct.

type BaseAPI Uses

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 Uses

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

type OfferConnection Uses

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

type OffersAPI Uses

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 Uses

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

NewOffersAPIV2 returns a new application offers OffersAPIV2 facade.

func (*OffersAPI) ApplicationOffers Uses

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

ApplicationOffers gets details about remote applications that match given URLs.

func (*OffersAPI) DestroyOffers Uses

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

DestroyOffers removes the offers specified by the given URLs.

func (*OffersAPI) FindApplicationOffers Uses

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

FindApplicationOffers gets details about remote applications that match given filter.

func (*OffersAPI) GetConsumeDetails Uses

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 Uses

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 Uses

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

ModifyOfferAccess changes the application offer access granted to users.

func (*OffersAPI) Offer Uses

func (api *OffersAPI) Offer(all params.AddApplicationOffers) (params.ErrorResults, error)

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

func (*OffersAPI) RemoteApplicationInfo Uses

func (api *OffersAPI) 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 GUI at this stage.

type OffersAPIV2 Uses

type OffersAPIV2 struct {
    *OffersAPI
}

OffersAPIV2 implements the cross model interface V2.

func NewOffersAPIV2 Uses

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

NewOffersAPIV2 returns a new application offers OffersAPIV2 facade.

func (*OffersAPIV2) DestroyOffers Uses

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

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

type Space Uses

type Space interface {
    Name() string
    Subnets() ([]Subnet, error)
    ProviderId() network.Id
}

type StatePool Uses

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 Uses

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

type User Uses

type User interface {
    DisplayName() string
}

Package applicationoffers imports 19 packages (graph) and is imported by 3 packages. Updated 2019-11-16. Refresh now. Tools for package owners.