crossmodel

package
v0.0.0-...-f7dd865 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: AGPL-3.0 Imports: 22 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFindEndpointsCommand

func NewFindEndpointsCommand() cmd.Command

NewFindEndpointsCommand constructs command that allows to find offered application endpoints.

func NewListEndpointsCommand

func NewListEndpointsCommand() cmd.Command

NewListEndpointsCommand constructs new list endpoint command.

func NewOfferCommand

func NewOfferCommand() cmd.Command

NewOfferCommand constructs commands that enables endpoints for export.

func NewRemoveOfferCommand

func NewRemoveOfferCommand() cmd.Command

NewRemoveOfferCommand returns a command used to remove a specified offer.

func NewShowOfferedEndpointCommand

func NewShowOfferedEndpointCommand() cmd.Command

NewShowOfferedEndpointCommand constructs command that allows to show details of offered application's endpoint.

func RelationStatusColor

func RelationStatusColor(status relation.Status) *ansiterm.Context

RelationStatusColor returns a context used to print the status with the relevant color.

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, owner, offerName, desc string) ([]params.ErrorResult, error)
}

OfferAPI defines the API methods that the offer command uses.

type OfferUser

type OfferUser struct {
	UserName    string `yaml:"-" json:"-"`
	DisplayName string `yaml:"display-name,omitempty" json:"display-name,omitempty"`
	Access      string `yaml:"access" json:"access"`
}

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.ModelCommandBase
}

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
}

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.

Jump to

Keyboard shortcuts

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