Documentation
¶
Index ¶
- func NewFindEndpointsCommand() cmd.Command
- func NewListEndpointsCommand() cmd.Command
- func NewOfferCommand() cmd.Command
- func NewRemoveOfferCommand() cmd.Command
- func NewShowOfferedEndpointCommand() cmd.Command
- func RelationStatusColor(status relation.Status) *ansiterm.Context
- type ApplicationOfferResult
- type FindAPI
- type ListAPI
- type ListOfferItem
- type OfferAPI
- type OfferUser
- type RemoteEndpoint
- type RemoteEndpointsCommandBase
- type RemoveAPI
- type ShowAPI
- type ShowOfferedApplication
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFindEndpointsCommand ¶
NewFindEndpointsCommand constructs command that allows to find offered application endpoints.
func NewListEndpointsCommand ¶
NewListEndpointsCommand constructs new list endpoint command.
func NewOfferCommand ¶
NewOfferCommand constructs commands that enables endpoints for export.
func NewRemoveOfferCommand ¶
NewRemoveOfferCommand returns a command used to remove a specified offer.
func NewShowOfferedEndpointCommand ¶
NewShowOfferedEndpointCommand constructs command that allows to show details of offered application's endpoint.
Types ¶
type ApplicationOfferResult ¶
type ApplicationOfferResult struct {
// Access is the level of access the user has on the offer.
Access string `yaml:"access" json:"access"`
// Endpoints is the list of offered application endpoints.
Endpoints map[string]RemoteEndpoint `yaml:"endpoints" json:"endpoints"`
// Users are the users who can access the offer.
Users map[string]OfferUser `yaml:"users,omitempty" json:"users,omitempty"`
}
ApplicationOfferResult defines the serialization behaviour of an application offer. This is used in map-style yaml output where offer URL is the key.
type FindAPI ¶
type FindAPI interface {
Close() error
FindApplicationOffers(filters ...crossmodel.ApplicationOfferFilter) ([]*crossmodel.ApplicationOfferDetails, error)
}
FindAPI defines the API methods that cross model find command uses.
type ListAPI ¶
type ListAPI interface {
Close() error
ListOffers(filters ...crossmodel.ApplicationOfferFilter) ([]*crossmodel.ApplicationOfferDetails, error)
}
ListAPI defines the API methods that list endpoints command use.
type ListOfferItem ¶
type ListOfferItem struct {
// OfferName is the name of the offer.
OfferName string `yaml:"-" json:"-"`
// ApplicationName is the application backing this offer.
ApplicationName string `yaml:"application" json:"application"`
// Store is the controller hosting this offer.
Source string `yaml:"store,omitempty" json:"store,omitempty"`
// CharmURL is the charm URL of this application.
CharmURL string `yaml:"charm,omitempty" json:"charm,omitempty"`
// OfferURL is part of Juju location where this offer is shared relative to the store.
OfferURL string `yaml:"offer-url" json:"offer-url"`
// Endpoints is a list of application endpoints.
Endpoints map[string]RemoteEndpoint `yaml:"endpoints" json:"endpoints"`
// Connections holds details of connections to the offer.
Connections []offerConnectionDetails `yaml:"connections,omitempty" json:"connections,omitempty"`
// Users are the users who can consume the offer.
Users map[string]OfferUser `yaml:"users,omitempty" json:"users,omitempty"`
}
ListOfferItem defines the serialization behaviour of an offer item in endpoints list.
type OfferAPI ¶
type OfferAPI interface {
Close() error
Offer(modelUUID, application string, endpoints []string, offerName string, desc string) ([]params.ErrorResult, error)
}
OfferAPI defines the API methods that the offer command uses.
type RemoteEndpoint ¶
type RemoteEndpoint struct {
// Name is the endpoint name.
Name string `yaml:"-" json:"-"`
// Interface is relation interface.
Interface string `yaml:"interface" json:"interface"`
// Role is relation role.
Role string `yaml:"role" json:"role"`
}
RemoteEndpoint defines the serialization behaviour of remote endpoints. This is used in map-style yaml output where remote endpoint name is the key.
type RemoteEndpointsCommandBase ¶
type RemoteEndpointsCommandBase struct {
modelcmd.ControllerCommandBase
}
RemoteEndpointsCommandBase is a base for various cross model commands.
func (*RemoteEndpointsCommandBase) NewRemoteEndpointsAPI ¶
func (c *RemoteEndpointsCommandBase) NewRemoteEndpointsAPI(controllerName string) (*applicationoffers.Client, error)
NewRemoteEndpointsAPI returns a remote endpoints api for the root api endpoint that the command returns.
type RemoveAPI ¶
type RemoveAPI interface {
Close() error
DestroyOffers(force bool, offerURLs ...string) error
BestAPIVersion() int
}
RemoveAPI defines the API methods that the remove offer command uses.
type ShowAPI ¶
type ShowAPI interface {
Close() error
ApplicationOffer(url string) (*crossmodel.ApplicationOfferDetails, error)
}
ShowAPI defines the API methods that cross model show command uses.
type ShowOfferedApplication ¶
type ShowOfferedApplication struct {
// Description is the user entered description.
Description string `yaml:"description,omitempty" json:"description,omitempty"`
// Access is the level of access the user has on the offer.
Access string `yaml:"access" json:"access"`
// Endpoints list of offered application endpoints.
Endpoints map[string]RemoteEndpoint `yaml:"endpoints" json:"endpoints"`
// Users are the users who can access the offer.
Users map[string]OfferUser `yaml:"users,omitempty" json:"users,omitempty"`
}
ShowOfferedApplication defines the serialization behaviour of an application offer. This is used in map-style yaml output where remote application name is the key.