juju: github.com/juju/juju/juju Index | Files | Directories

package juju

import "github.com/juju/juju/juju"

Index

Package Files

api.go home.go

func InitJujuXDGDataHome Uses

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 NewAPIConnection Uses

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 Uses

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.

type NewAPIConnectionParams Uses

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 Uses

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

    // 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

PathSynopsis
keys
names
osenv
sockets
testing

Package juju imports 12 packages (graph) and is imported by 281 packages. Updated 2019-12-11. Refresh now. Tools for package owners.