import "github.com/juju/juju/juju"
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 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(
store jujuclient.ControllerStore, controllerName string,
params UpdateControllerParams,
) errorUpdateControllerDetailsFromLogin 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.
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 struct {
// AgentVersion is the version of the controller agent.
AgentVersion string
// CurrentHostPorts are the available api addresses.
CurrentHostPorts [][]network.HostPort
// 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
// 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.
| Path | Synopsis |
|---|---|
| keys | |
| names | |
| osenv | |
| paths | |
| sockets | |
| testing |
Package juju imports 12 packages (graph) and is imported by 260 packages. Updated 2017-12-03. Refresh now. Tools for package owners.