juju: github.com/juju/juju/core/crossmodel Index | Files

package crossmodel

import "github.com/juju/juju/core/crossmodel"

Index

Package Files

externalcontroller.go interface.go offerurl.go params.go

func MakeURL Uses

func MakeURL(user, model, application, controller string) string

MakeURL constructs an offer URL from the specified components.

type AddApplicationOfferArgs Uses

type AddApplicationOfferArgs struct {
    // OfferName is the name of the offer.
    OfferName string

    // Owner is the user name who owns the offer.
    Owner string

    // HasRead are the user names who can see the offer exists.
    HasRead []string

    // ApplicationName is the name of the application to which the offer pertains.
    ApplicationName string

    // ApplicationDescription is a description of the application's functionality,
    // typically copied from the charm metadata.
    ApplicationDescription string

    // Endpoints is the collection of endpoint names offered (internal->published).
    // The map allows for advertised endpoint names to be aliased.
    Endpoints map[string]string

    // Icon is an icon to display when browsing the ApplicationOffers, which by default
    // comes from the charm.
    Icon []byte
}

AddApplicationOfferArgs contains parameters used to create an application offer.

type ApplicationOffer Uses

type ApplicationOffer struct {
    // OfferUUID is the UUID of the offer.
    OfferUUID string

    // OfferName is the name of the offer.
    OfferName string

    // ApplicationName is the name of the application to which the offer pertains.
    ApplicationName string

    // ApplicationDescription is a description of the application's functionality,
    // typically copied from the charm metadata.
    ApplicationDescription string

    // Endpoints is the collection of endpoint names offered (internal->published).
    // The map allows for advertised endpoint names to be aliased.
    Endpoints map[string]charm.Relation
}

ApplicationOffer holds the details of an application offered by this model.

func (*ApplicationOffer) String Uses

func (s *ApplicationOffer) String() string

String returns the offered application name.

type ApplicationOfferDetails Uses

type ApplicationOfferDetails struct {
    // OfferName is the name of the offer
    OfferName string

    // ApplicationName is the application name to which the offer pertains.
    ApplicationName string

    // ApplicationDescription is the application description.
    ApplicationDescription string

    // OfferURL is the URL where the offer can be located.
    OfferURL string

    // CharmURL is the URL of the charm for the remote application.
    CharmURL string

    // Endpoints are the charm endpoints supported by the application.
    // TODO(wallyworld) - do not use charm.Relation here
    Endpoints []charm.Relation

    // Connects are the connections to the offer.
    Connections []OfferConnection

    // Users are the users able to access the offer.
    Users []OfferUserDetails
}

ApplicationOfferAdminDetails represents the details about an application offer. Depending on the access permission of the user making the API call, and whether the call is "find" or "list", not all fields will be populated.

type ApplicationOfferFilter Uses

type ApplicationOfferFilter struct {
    // OwnerName is the owner of the model hosting the offer.
    OwnerName string

    // ModelName is the name of the model hosting the offer.
    ModelName string

    // OfferName is the name of the offer.
    OfferName string

    // ApplicationName is the name of the application to which the offer pertains.
    ApplicationName string

    // ApplicationDescription is a description of the application's functionality,
    // typically copied from the charm metadata.
    ApplicationDescription string

    // Endpoint contains an endpoint filter criteria.
    Endpoints []EndpointFilterTerm

    // AllowedConsumers are the users allowed to consume the offer.
    AllowedConsumers []string

    // ConnectedUsers are the users currently related to the offer.
    ConnectedUsers []string
}

ApplicationOfferFilter is used to query applications offered by this model.

type ApplicationOffers Uses

type ApplicationOffers interface {

    // AddOffer adds a new application offer to the directory.
    AddOffer(offer AddApplicationOfferArgs) (*ApplicationOffer, error)

    // UpdateOffer replaces an existing offer at the same URL.
    UpdateOffer(offer AddApplicationOfferArgs) (*ApplicationOffer, error)

    // ApplicationOffer returns the named application offer.
    ApplicationOffer(offerName string) (*ApplicationOffer, error)

    // ApplicationOfferForUUID returns the application offer with the UUID.
    ApplicationOfferForUUID(offerUUID string) (*ApplicationOffer, error)

    // ListOffers returns the offers satisfying the specified filter.
    ListOffers(filter ...ApplicationOfferFilter) ([]ApplicationOffer, error)

    // Remove removes the application offer at the specified URL.
    Remove(offerName string, force bool) error

    // AllApplicationOffers returns all application offers in the model.
    AllApplicationOffers() (offers []*ApplicationOffer, _ error)
}

An ApplicationOffers instance holds application offers from a model.

type ConsumeApplicationArgs Uses

type ConsumeApplicationArgs struct {
    // Offer is the offer to be consumed.
    Offer params.ApplicationOfferDetails

    // Macaroon is used for authentication.
    Macaroon *macaroon.Macaroon

    // ControllerInfo contains connection details to the controller
    // hosting the offer.
    ControllerInfo *ControllerInfo

    // ApplicationAlias is the name of the alias to use for the application name.
    ApplicationAlias string
}

ConsumeApplicationArgs contains parameters used to consume an offer.

type ControllerInfo Uses

type ControllerInfo struct {
    // ControllerTag holds tag for the controller.
    ControllerTag names.ControllerTag

    // Alias holds a (human friendly) alias for the controller.
    Alias string

    // Addrs holds the addresses and ports of the controller's API servers.
    Addrs []string

    // CACert holds the CA certificate that will be used to validate
    // the API server's certificate, in PEM format.
    CACert string
}

ControllerInfo holds the details required to connect to a controller.

func (*ControllerInfo) Validate Uses

func (info *ControllerInfo) Validate() error

Validate returns an error if the ControllerInfo contains bad data.

type EndpointFilterTerm Uses

type EndpointFilterTerm struct {
    // Name is an endpoint name.
    Name string

    // Interface is an endpoint interface.
    Interface string

    // Role is an endpoint role.
    Role charm.RelationRole
}

EndpointFilterTerm represents a remote endpoint filter.

type OfferConnection Uses

type OfferConnection struct {
    // SourceModelUUID is the UUID of the model hosting the offer.
    SourceModelUUID string

    // Username is the name of the user consuming the offer.
    Username string

    // RelationId is the id of the relation for this connection.
    RelationId int

    // Endpoint is the endpoint being connected to.
    Endpoint string

    // Status is the status of the offer connection.
    Status relation.Status

    // Message is the status message of the offer connection.
    Message string

    // Since is when the status value was last changed.
    Since *time.Time

    // IngressSubnets is the list of subnets from which traffic will originate.
    IngressSubnets []string
}

OfferConnection holds details about a connection to an offer.

type OfferURL Uses

type OfferURL struct {
    // Source represents where the offer is hosted.
    // If empty, the model is another model in the same controller.
    Source string // "<controller-name>" or "<jaas>" or ""

    // User is the user whose namespace in which the offer is made.
    // Where a model is specified, the user is the model owner.
    User string

    // ModelName is the name of the model providing the exported endpoints.
    // It is only used for local URLs or for specifying models in the same
    // controller.
    ModelName string

    // ApplicationName is the name of the application providing the exported endpoints.
    ApplicationName string
}

OfferURL represents the location of an offered application and its associated exported endpoints.

func ParseOfferURL Uses

func ParseOfferURL(urlStr string) (*OfferURL, error)

ParseOfferURL parses the specified URL string into an OfferURL. The URL string is of one of the forms:

<model-name>.<application-name>
<model-name>.<application-name>:<relation-name>
<user>/<model-name>.<application-name>
<user>/<model-name>.<application-name>:<relation-name>
<controller>:<user>/<model-name>.<application-name>
<controller>:<user>/<model-name>.<application-name>:<relation-name>

func (*OfferURL) AsLocal Uses

func (u *OfferURL) AsLocal() *OfferURL

AsLocal returns a copy of the URL with an empty (local) source.

func (*OfferURL) HasEndpoint Uses

func (u *OfferURL) HasEndpoint() bool

HasEndpoint returns whether this offer URL includes an endpoint name in the application name.

func (*OfferURL) Path Uses

func (u *OfferURL) Path() string

Path returns the path component of the URL.

func (*OfferURL) String Uses

func (u *OfferURL) String() string

type OfferURLParts Uses

type OfferURLParts OfferURL

OfferURLParts contains various attributes of a URL.

func ParseOfferURLParts Uses

func ParseOfferURLParts(urlStr string) (*OfferURLParts, error)

ParseOfferURLParts parses a partial URL, filling out what parts are supplied. This method is used to generate a filter used to query matching offer URLs.

type OfferUserDetails Uses

type OfferUserDetails struct {
    // UserName is the username of the user.
    UserName string

    // DisplayName is the display name of the user.
    DisplayName string

    // Access is the level of access to the offer.
    Access permission.Access
}

OfferUserDetails holds the details about a user's access to an offer.

type RemoteApplication Uses

type RemoteApplication struct {
    ApplicationOffer

    // ConnectedUsers are the users that are consuming the application.
    ConnectedUsers []string
}

RemoteApplication represents a remote application.

Package crossmodel imports 12 packages (graph) and is imported by 64 packages. Updated 2019-08-26. Refresh now. Tools for package owners.