juju

package
v0.0.0-...-e653fdf Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: AGPL-3.0 Imports: 14 Imported by: 82

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitJujuXDGDataHome

func InitJujuXDGDataHome() error

InitJujuXDGDataHome initializes the charm cache, environs/config and utils/ssh packages to use default paths based on the $JUJU_DATA or $HOME environment variables. This function should be called before running a Juju CLI command.

func IsNoAddressesError

func IsNoAddressesError(err error) bool

IsNoAddressesError reports whether the error (from NewAPIConnection) is an error due to the controller having no API addresses yet (likely because a bootstrap is still in progress).

func NewAPIConnection

func NewAPIConnection(args NewAPIConnectionParams) (_ api.Connection, err error)

NewAPIConnection returns an api.Connection to the specified Juju controller, with specified account credentials, optionally scoped to the specified model name.

func UpdateControllerDetailsFromLogin

func UpdateControllerDetailsFromLogin(
	store jujuclient.ControllerStore, controllerName string,
	params UpdateControllerParams,
) error

UpdateControllerDetailsFromLogin writes any new api addresses and other relevant details to the client controller file. Controller may be specified by a UUID or name, and must already exist.

Types

type NewAPIConnectionParams

type NewAPIConnectionParams struct {
	// ControllerName is the name of the controller to connect to.
	ControllerName string

	// Store is the jujuclient.ClientStore from which the controller's
	// details will be fetched, and updated on address changes.
	Store jujuclient.ClientStore

	// OpenAPI is the function that will be used to open API connections.
	OpenAPI api.OpenFunc

	// DialOpts contains the options used to dial the API connection.
	DialOpts api.DialOpts

	// AccountDetails contains the account details to use for logging
	// in to the Juju API. If this is nil, then no login will take
	// place. If AccountDetails.Password and AccountDetails.Macaroon
	// are zero, the login will be as an external user.
	AccountDetails *jujuclient.AccountDetails

	// ModelUUID is an optional model UUID. If specified, the API connection
	// will be scoped to the model with that UUID; otherwise it will be
	// scoped to the controller.
	ModelUUID string
}

NewAPIConnectionParams contains the parameters for creating a new Juju API connection.

type UpdateControllerParams

type UpdateControllerParams struct {
	// AgentVersion is the version of the controller agent.
	AgentVersion string

	// CurrentHostPorts are the available api addresses.
	CurrentHostPorts []network.MachineHostPorts

	// AddrConnectedTo (when set) is an API address that has been recently
	// connected to.
	AddrConnectedTo string

	// IPAddrConnected to (when set) is the IP address of AddrConnectedTo
	// that has been recently connected to.
	IPAddrConnectedTo string

	// Proxier
	Proxier proxy.Proxier

	// DNSCache holds entries in the DNS cache.
	DNSCache map[string][]string

	// PublicDNSName (when set) holds the public host name of the controller.
	PublicDNSName *string

	// ControllerMachineCount (when set) is the total number of controller machines in the environment.
	ControllerMachineCount *int

	// MachineCount (when set) is the total number of machines in the models.
	MachineCount *int
}

UpdateControllerParams holds values used to update a controller details after bootstrap or a login operation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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