lxd

package module
v0.0.0-...-9ff6e62 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2017 License: Apache-2.0 Imports: 27 Imported by: 0

README

LXD

REST API, command line tool and OpenStack integration plugin for LXC.

LXD is pronounced lex-dee.

To easily see what LXD is about, you can try it online.

Status

  • GoDoc: GoDoc
  • Jenkins (Linux): Build Status
  • Travis (macOS): Build Status
  • AppVeyor (Windows): Build Status
  • Weblate (translations): Translation status

Getting started with LXD

Since LXD development is happening at such a rapid pace, we only provide daily builds right now. They're available via:

sudo add-apt-repository ppa:ubuntu-lxc/lxd-git-master && sudo apt-get update
sudo apt-get install lxd

Because group membership is only applied at login, you then either need to close and re-open your user session or use the "newgrp lxd" command in the shell you're going to interact with lxd from.

newgrp lxd

After you've got LXD installed and a session with the right permissions, you can take your first steps.

Getting started with LXD on Windows

LXD server is not available on Windows, but it is possible to use lxc client with some limitations to control remote containers.

Using the REST API

The LXD REST API can be used locally via unauthenticated Unix socket or remotely via SSL encapsulated TCP.

via Unix socket
curl --unix-socket /var/lib/lxd/unix.socket \
    -H "Content-Type: application/json" \
    -X POST \
    -d @hello-ubuntu.json \
    lxd/1.0/containers
via TCP

TCP requires some additional configuration and is not enabled by default.

lxc config set core.https_address "[::]:8443"
curl -k -L \
    --cert ~/.config/lxc/client.crt \
    --key ~/.config/lxc/client.key \
    -H "Content-Type: application/json" \
    -X POST \
    -d @hello-ubuntu.json \
    "https://127.0.0.1:8443/1.0/containers"
JSON payload

The hello-ubuntu.json file referenced above could contain something like:

{
    "name":"some-ubuntu",
    "ephemeral":true,
    "config":{
        "limits.cpu":"2"
    },
    "source": {
        "type":"image",
        "mode":"pull",
        "protocol":"simplestreams",
        "server":"https://cloud-images.ubuntu.com/releases",
        "alias":"14.04"
    }
}

Building from source

We recommend having the latest versions of liblxc (>= 2.0.0 required) and CRIU (>= 1.7 recommended) available for LXD development. Additionally, LXD requires Golang 1.5 or later to work. All the right versions dependencies are available via the LXD PPA:

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ubuntu-lxc/lxd-git-master
sudo apt-get update
sudo apt-get install acl dnsmasq-base git golang liblxc1 lxc-dev make pkg-config rsync squashfs-tools tar xz-utils

There are a few storage backends for LXD besides the default "directory" backend. Installing these tools adds a bit to initramfs and may slow down your host boot, but are needed if you'd like to use a particular backend:

sudo apt-get install lvm2 thin-provisioning-tools
sudo apt-get install btrfs-tools

To run the testsuite, you'll also need:

sudo apt-get install curl gettext jq sqlite3 uuid-runtime bzr
Building the tools

LXD consists of two binaries, a client called lxc and a server called lxd. These live in the source tree in the lxc/ and lxd/ dirs, respectively. To get the code, set up your go environment:

mkdir -p ~/go
export GOPATH=~/go

And then download it as usual:

go get github.com/lxc/lxd
cd $GOPATH/src/github.com/lxc/lxd
make

...which will give you two binaries in $GOPATH/bin, lxd the daemon binary, and lxc a command line client to that daemon.

Machine Setup

You'll need sub{u,g}ids for root, so that LXD can create the unprivileged containers:

echo "root:1000000:65536" | sudo tee -a /etc/subuid /etc/subgid

Now you can run the daemon (the --group sudo bit allows everyone in the sudo group to talk to LXD; you can create your own group if you want):

sudo -E $GOPATH/bin/lxd --group sudo

First steps

LXD has two parts, the daemon (the lxd binary), and the client (the lxc binary). Now that the daemon is all configured and running (either via the packaging or via the from-source instructions above), you can create a container:

$GOPATH/bin/lxc launch ubuntu:14.04

Alternatively, you can also use a remote LXD host as a source of images. One comes pre-configured in LXD, called "images" (images.linuxcontainers.org)

$GOPATH/bin/lxc launch images:centos/7/amd64 centos

Bug reports

Bug reports can be filed at https://github.com/lxc/lxd/issues/new

Contributing

Fixes and new features are greatly appreciated but please read our contributing guidelines first.

Contributions to this project should be sent as pull requests on github.

Hacking

Sometimes it is useful to view the raw response that LXD sends; you can do this by:

lxc config set core.trust_password foo
lxc remote add local 127.0.0.1:8443
wget --no-check-certificate https://127.0.0.1:8443/1.0 --certificate=$HOME/.config/lxc/client.crt --private-key=$HOME/.config/lxc/client.key -O - -q

Upgrading

The lxd and lxc (lxd-client) binaries should be upgraded at the same time with:

apt-get update
apt-get install lxd lxd-client

Support and discussions

We use the LXC mailing-lists for developer and user discussions, you can find and subscribe to those at: https://lists.linuxcontainers.org

If you prefer live discussions, some of us also hang out in #lxcontainers on irc.freenode.net.

FAQ

How to enable LXD server for remote access?

By default LXD server is not accessible from the networks as it only listens on a local unix socket. You can make LXD available from the network by specifying additional addresses to listen to. This is done with the core.https_address config variable.

To see the current server configuration, run:

lxc config show

To set the address to listen to, find out what addresses are available and use the config set command on the server:

ip addr
lxc config set core.https_address 192.168.1.15
When I do a lxc remote add over https, it asks for a password?

By default, LXD has no password for security reasons, so you can't do a remote add this way. In order to set a password, do:

lxc config set core.trust_password SECRET

on the host LXD is running on. This will set the remote password that you can then use to do lxc remote add.

You can also access the server without setting a password by copying the client certificate from .config/lxc/client.crt to the server and adding it with:

lxc config trust add client.crt
How do I configure LXD storage?

LXD supports btrfs, directory, lvm and zfs based storage.

First make sure you have the relevant tools for your filesystem of choice installed on the machine (btrfs-progs, lvm2 or zfsutils-linux).

By default, LXD comes with no configured network or storage. You can get a basic configuration done with:

lxd init

"lxd init" supports both directory based storage and ZFS. If you want something else, you'll need to use the "lxc storage" command:

lxc storage create default BACKEND [OPTIONS...]
lxc profile device add default root disk path=/ pool=default

BACKEND is one of "btrfs", "dir", "lvm" or "zfs".

Unless specified otherwise, LXD will setup loop based storage with a sane default size.

For production environments, you should be using block backed storage instead both for performance and reliability reasons.

How can I live migrate a container using LXD?

Live migration requires a tool installed on both hosts called CRIU, which is available in Ubuntu via:

sudo apt-get install criu

Then, launch your container with the following,

lxc launch ubuntu $somename
sleep 5s # let the container get to an interesting state
lxc move host1:$somename host2:$somename

And with luck you'll have migrated the container :). Migration is still in experimental stages and may not work for all workloads. Please report bugs on lxc-devel, and we can escalate to CRIU lists as necessary.

Can I bind mount my home directory in a container?

Yes. The easiest way to do that is using a privileged container:

1.a) create a container.

lxc launch ubuntu privilegedContainerName -c security.privileged=true

1.b) or, if your container already exists.

    lxc config set privilegedContainerName security.privileged true
  1. then.

    lxc config device add privilegedContainerName shareName disk source=/home/$USER path=/home/ubuntu

How can I run docker inside a LXD container?

In order to run Docker inside a LXD container the security.nesting property of the container should be set to true. No other changes should be necessary.

lxc config set <container> security.nesting true

Documentation

Overview

DEPRECATED: This package is now deprecated in favor of github.com/lxc/lxd/client

This package will be entirely removed from the code tree with LXD 2.16

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	Remotes:       DefaultRemotes,
	DefaultRemote: "local"}
View Source
var DefaultRemotes = map[string]RemoteConfig{
	"images":       ImagesRemote,
	"local":        LocalRemote,
	"ubuntu":       UbuntuRemote,
	"ubuntu-daily": UbuntuDailyRemote}
View Source
var ImagesRemote = RemoteConfig{
	Addr:     "https://images.linuxcontainers.org",
	Public:   true,
	Protocol: "simplestreams"}
View Source
var (
	// LXDErrors are special errors; the client library hoists error codes
	// to these errors internally so that user code can compare against
	// them. We probably shouldn't hoist BadRequest or InternalError, since
	// LXD passes an error string along which is more informative than
	// whatever static error message we would put here.
	LXDErrors = map[int]error{
		http.StatusNotFound: fmt.Errorf("not found"),
	}
)
View Source
var LocalRemote = RemoteConfig{
	Addr:   "unix://",
	Static: true,
	Public: false}
View Source
var StaticRemotes = map[string]RemoteConfig{
	"local":        LocalRemote,
	"ubuntu":       UbuntuRemote,
	"ubuntu-daily": UbuntuDailyRemote}
View Source
var UbuntuDailyRemote = RemoteConfig{
	Addr:     "https://cloud-images.ubuntu.com/daily",
	Static:   true,
	Public:   true,
	Protocol: "simplestreams"}
View Source
var UbuntuRemote = RemoteConfig{
	Addr:     "https://cloud-images.ubuntu.com/releases",
	Static:   true,
	Public:   true,
	Protocol: "simplestreams"}

Functions

func GetLocalLXDErr

func GetLocalLXDErr(err error) error

GetLocalLXDErr determines whether or not an error is likely due to a local LXD configuration issue, and if so, returns the underlying error. GetLocalLXDErr can be used to provide customized error messages to help the user identify basic system issues, e.g. LXD daemon not running.

Returns syscall.ENOENT, syscall.ECONNREFUSED or syscall.EACCES when a local LXD configuration issue is detected, nil otherwise.

func HoistResponse

func HoistResponse(r *http.Response, rtype api.ResponseType) (*api.Response, error)

HoistResponse hoists a regular http response into a response of type rtype or returns a golang error.

func ParseResponse

func ParseResponse(r *http.Response) (*api.Response, error)

ParseResponse parses a lxd style response out of an http.Response. Note that this does _not_ automatically convert error responses to golang errors. To do that, use ParseError. Internal client library uses should probably use HoistResponse, unless they are interested in accessing the underlying Error response (e.g. to inspect the error code).

func SaveConfig

func SaveConfig(c *Config, fname string) error

SaveConfig writes the provided configuration to the config file.

func WebsocketDial

func WebsocketDial(dialer websocket.Dialer, url string) (*websocket.Conn, error)

WebsocketDial attempts to dial a websocket to a LXD instance, parsing LXD-style errors and returning them as go errors.

Types

type Client

type Client struct {
	BaseURL     string
	BaseWSURL   string
	Config      Config
	Name        string
	Remote      *RemoteConfig
	Transport   string
	Certificate string

	Http http.Client
	// contains filtered or unexported fields
}

Client can talk to a LXD daemon.

func NewClient

func NewClient(config *Config, remote string) (*Client, error)

NewClient returns a new LXD client.

func NewClientFromInfo

func NewClientFromInfo(info ConnectInfo) (*Client, error)

NewClientFromInfo returns a new LXD client.

func (*Client) Action

func (c *Client) Action(name string, action shared.ContainerAction, timeout int, force bool, stateful bool) (*api.Response, error)

func (*Client) AddMyCertToServer

func (c *Client) AddMyCertToServer(pwd string) error

func (*Client) Addresses

func (c *Client) Addresses() ([]string, error)

func (*Client) AmTrusted

func (c *Client) AmTrusted() bool

func (*Client) AssignProfile

func (c *Client) AssignProfile(container, profile string) (*api.Response, error)

func (*Client) AsyncWaitMeta

func (c *Client) AsyncWaitMeta(resp *api.Response) (map[string]interface{}, error)

func (*Client) CertificateAdd

func (c *Client) CertificateAdd(cert *x509.Certificate, name string) error

func (*Client) CertificateList

func (c *Client) CertificateList() ([]api.Certificate, error)

func (*Client) CertificateRemove

func (c *Client) CertificateRemove(fingerprint string) error

func (*Client) ContainerDeviceAdd

func (c *Client) ContainerDeviceAdd(container, devname, devtype string, props []string) (*api.Response, error)

func (*Client) ContainerDeviceDelete

func (c *Client) ContainerDeviceDelete(container, devname string) (*api.Response, error)

func (*Client) ContainerInfo

func (c *Client) ContainerInfo(name string) (*api.Container, error)

func (*Client) ContainerListDevices

func (c *Client) ContainerListDevices(container string) ([]string, error)

func (*Client) ContainerState

func (c *Client) ContainerState(name string) (*api.ContainerState, error)

func (*Client) CopyImage

func (c *Client) CopyImage(image string, dest *Client, copy_aliases bool, aliases []string, public bool, autoUpdate bool, progressHandler func(progress string)) error

func (*Client) Delete

func (c *Client) Delete(name string) (*api.Response, error)

func (*Client) DeleteAlias

func (c *Client) DeleteAlias(alias string) error

func (*Client) DeleteFile

func (c *Client) DeleteFile(container string, p string) error

func (*Client) DeleteImage

func (c *Client) DeleteImage(image string) error

func (*Client) Exec

func (c *Client) Exec(name string, cmd []string, env map[string]string,
	stdin io.ReadCloser, stdout io.WriteCloser,
	stderr io.WriteCloser, controlHandler func(*Client, *websocket.Conn),
	width int, height int) (int, error)

Exec runs a command inside the LXD container. For "interactive" use such as `lxc exec ...`, one should pass a controlHandler that talks over the control socket and handles things like SIGWINCH. If running non-interactive, passing a nil controlHandler will cause Exec to return when all of the command output is sent to the output buffers.

func (*Client) ExportImage

func (c *Client) ExportImage(image string, target string) (string, error)

func (*Client) GetAlias

func (c *Client) GetAlias(alias string) string

func (*Client) GetContainerConfig

func (c *Client) GetContainerConfig(container string) ([]string, error)

* return string array representing a container's full configuration

func (*Client) GetImageInfo

func (c *Client) GetImageInfo(image string) (*api.Image, error)

func (*Client) GetLog

func (c *Client) GetLog(container string, log string) (io.Reader, error)

func (*Client) GetMigrationSourceWS

func (c *Client) GetMigrationSourceWS(container string, stateful bool, containerOnly bool) (*api.Response, error)

func (*Client) GetOperation

func (c *Client) GetOperation(url string) (*api.Operation, error)

func (*Client) GetProfileConfig

func (c *Client) GetProfileConfig(profile string) (map[string]string, error)

func (*Client) GetServerConfig

func (c *Client) GetServerConfig() (*api.Response, error)

func (*Client) GetServerConfigString

func (c *Client) GetServerConfigString() ([]string, error)

func (*Client) ImageFromContainer

func (c *Client) ImageFromContainer(cname string, public bool, aliases []string, properties map[string]string, compression_algorithm string) (string, error)

func (*Client) Init

func (c *Client) Init(name string, imgremote string, image string, profiles *[]string, config map[string]string, devices map[string]map[string]string, ephem bool) (*api.Response, error)

Init creates a container from either a fingerprint or an alias; you must provide at least one.

func (*Client) IsAlias

func (c *Client) IsAlias(alias string) (bool, error)

func (*Client) IsPublic

func (c *Client) IsPublic() bool

func (*Client) ListAliases

func (c *Client) ListAliases() ([]api.ImageAliasesEntry, error)

func (*Client) ListContainers

func (c *Client) ListContainers() ([]api.Container, error)

func (*Client) ListImages

func (c *Client) ListImages() ([]api.Image, error)

func (*Client) ListNetworks

func (c *Client) ListNetworks() ([]api.Network, error)

func (*Client) ListProfiles

func (c *Client) ListProfiles() ([]api.Profile, error)

func (*Client) ListSnapshots

func (c *Client) ListSnapshots(container string) ([]api.ContainerSnapshot, error)

func (*Client) ListStoragePools

func (c *Client) ListStoragePools() ([]api.StoragePool, error)

Storage functions

func (*Client) LocalCopy

func (c *Client) LocalCopy(source string, name string, config map[string]string, profiles []string, ephemeral bool, containerOnly bool) (*api.Response, error)

func (*Client) MigrateFrom

func (c *Client) MigrateFrom(name string, operation string, certificate string,
	sourceSecrets map[string]string, architecture string, config map[string]string,
	devices map[string]map[string]string, profiles []string,
	baseImage string, ephemeral bool, push bool, sourceClient *Client,
	sourceOperation string, containerOnly bool) (*api.Response, error)

func (*Client) Mkdir

func (c *Client) Mkdir(container string, p string, mode os.FileMode, uid int, gid int) error

func (*Client) MkdirP

func (c *Client) MkdirP(container string, p string, mode os.FileMode, uid int, gid int) error

func (*Client) Monitor

func (c *Client) Monitor(types []string, handler func(interface{}), done chan bool) error

func (*Client) NetworkCreate

func (c *Client) NetworkCreate(name string, config map[string]string) error

Network functions

func (*Client) NetworkDelete

func (c *Client) NetworkDelete(name string) error

func (*Client) NetworkGet

func (c *Client) NetworkGet(name string) (api.Network, error)

func (*Client) NetworkPut

func (c *Client) NetworkPut(name string, network api.NetworkPut) error

func (*Client) PostAlias

func (c *Client) PostAlias(alias string, desc string, target string) error

func (*Client) PostImage

func (c *Client) PostImage(imageFile string, rootfsFile string, properties []string, public bool, aliases []string, progressHandler func(int64, int64)) (string, error)

func (*Client) PostImageURL

func (c *Client) PostImageURL(imageFile string, properties []string, public bool, aliases []string, progressHandler func(progress string)) (string, error)

func (*Client) ProfileConfig

func (c *Client) ProfileConfig(name string) (*api.Profile, error)

func (*Client) ProfileCopy

func (c *Client) ProfileCopy(name, newname string, dest *Client) error

func (*Client) ProfileCreate

func (c *Client) ProfileCreate(p string) error

func (*Client) ProfileDelete

func (c *Client) ProfileDelete(p string) error

func (*Client) ProfileDeviceAdd

func (c *Client) ProfileDeviceAdd(profile, devname, devtype string, props []string) (*api.Response, error)

func (*Client) ProfileDeviceDelete

func (c *Client) ProfileDeviceDelete(profile, devname string) (*api.Response, error)

func (*Client) ProfileListDevices

func (c *Client) ProfileListDevices(profile string) ([]string, error)

func (*Client) PullFile

func (c *Client) PullFile(container string, p string) (int64, int64, int, string, io.ReadCloser, []string, error)

func (*Client) PushFile

func (c *Client) PushFile(container string, p string, gid int, uid int, mode string, buf io.ReadSeeker) error

func (*Client) PutImageInfo

func (c *Client) PutImageInfo(name string, p api.ImagePut) error

func (*Client) PutProfile

func (c *Client) PutProfile(name string, profile api.ProfilePut) error

func (*Client) RecursivePullFile

func (c *Client) RecursivePullFile(container string, p string, targetDir string) error

func (*Client) RecursivePushFile

func (c *Client) RecursivePushFile(container string, source string, target string) error

func (*Client) RefreshImage

func (c *Client) RefreshImage(image string, progressHandler func(progress string)) (bool, error)

Refresh an image. Return a bool indicating whether the image was actually refreshed.

func (*Client) Rename

func (c *Client) Rename(name string, newName string) (*api.Response, error)

func (*Client) RestoreSnapshot

func (c *Client) RestoreSnapshot(container string, snapshotName string, stateful bool) (*api.Response, error)

func (*Client) ServerStatus

func (c *Client) ServerStatus() (*api.Server, error)

func (*Client) SetContainerConfig

func (c *Client) SetContainerConfig(container, key, value string) error

func (*Client) SetProfileConfigItem

func (c *Client) SetProfileConfigItem(profile, key, value string) error

func (*Client) SetServerConfig

func (c *Client) SetServerConfig(key string, value string) (*api.Response, error)

func (*Client) Snapshot

func (c *Client) Snapshot(container string, snapshotName string, stateful bool) (*api.Response, error)

func (*Client) SnapshotInfo

func (c *Client) SnapshotInfo(snapName string) (*api.ContainerSnapshot, error)

func (*Client) StoragePoolCreate

func (c *Client) StoragePoolCreate(name string, driver string, config map[string]string) error

func (*Client) StoragePoolDelete

func (c *Client) StoragePoolDelete(name string) error

func (*Client) StoragePoolGet

func (c *Client) StoragePoolGet(name string) (api.StoragePool, error)

func (*Client) StoragePoolPut

func (c *Client) StoragePoolPut(name string, pool api.StoragePool) error

func (*Client) StoragePoolVolumeTypeCreate

func (c *Client) StoragePoolVolumeTypeCreate(pool string, volume string, volumeType string, config map[string]string) error

/1.0/storage-pools/{pool}/volumes/{volume_type}

func (*Client) StoragePoolVolumeTypeDelete

func (c *Client) StoragePoolVolumeTypeDelete(pool string, volume string, volumeType string) error

/1.0/storage-pools/{pool}/volumes/{type}/{name}

func (*Client) StoragePoolVolumeTypeGet

func (c *Client) StoragePoolVolumeTypeGet(pool string, volume string, volumeType string) (api.StorageVolume, error)

/1.0/storage-pools/{pool}/volumes/{type}/{name}

func (*Client) StoragePoolVolumeTypePut

func (c *Client) StoragePoolVolumeTypePut(pool string, volume string, volumeType string, volumeConfig api.StorageVolume) error

/1.0/storage-pools/{pool}/volumes/{type}/{name}

func (*Client) StoragePoolVolumesList

func (c *Client) StoragePoolVolumesList(pool string) ([]api.StorageVolume, error)

/1.0/storage-pools/{name}/volumes

func (*Client) UpdateContainerConfig

func (c *Client) UpdateContainerConfig(container string, st api.ContainerPut) error

func (*Client) UpdateServerConfig

func (c *Client) UpdateServerConfig(ss api.ServerPut) (*api.Response, error)

func (*Client) WaitFor

func (c *Client) WaitFor(waitURL string) (*api.Operation, error)

Wait for an operation

func (*Client) WaitForSuccess

func (c *Client) WaitForSuccess(waitURL string) error

func (*Client) WaitForSuccessOp

func (c *Client) WaitForSuccessOp(waitURL string) (*api.Operation, error)

func (*Client) Websocket

func (c *Client) Websocket(operation string, secret string) (*websocket.Conn, error)

type Config

type Config struct {
	// DefaultRemote holds the remote daemon name from the Remotes map
	// that the client should communicate with by default.
	// If empty it defaults to "local".
	DefaultRemote string `yaml:"default-remote"`

	// Remotes defines a map of remote daemon names to the details for
	// communication with the named daemon.
	// The implicit "local" remote is always available and communicates
	// with the local daemon over a unix socket.
	Remotes map[string]RemoteConfig `yaml:"remotes"`

	// Command line aliases for `lxc`
	Aliases map[string]string `yaml:"aliases"`

	// This is the path to the config directory, so the client can find
	// previously stored server certs, give good error messages, and save
	// new server certs, etc.
	//
	// We don't need to store it, because of course once we've loaded this
	// structure we already know where it is :)
	ConfigDir string `yaml:"-"`
}

Config holds settings to be used by a client or daemon.

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig reads the configuration from the config path; if the path does not exist, it returns a default configuration.

func (*Config) ConfigPath

func (c *Config) ConfigPath(file string) string

func (*Config) ParseRemote

func (c *Config) ParseRemote(raw string) string

func (*Config) ParseRemoteAndContainer

func (c *Config) ParseRemoteAndContainer(raw string) (string, string)

func (*Config) ServerCertPath

func (c *Config) ServerCertPath(name string) string

type ConnectInfo

type ConnectInfo struct {
	// Name is a simple identifier for the remote server. In 'lxc' it is
	// the name used to lookup the address and other information in the
	// config.yml file.
	Name string
	// RemoteConfig is the information about the Remote that we are
	// connecting to. This includes information like if the remote is
	// Public and/or Static.
	RemoteConfig RemoteConfig
	// ClientPEMCert is the PEM encoded bytes of the client's certificate.
	// If Addr indicates a Unix socket, the certificate and key bytes will
	// not be used.
	ClientPEMCert string
	// ClientPEMKey is the PEM encoded private bytes of the client's key associated with its certificate
	ClientPEMKey string
	// ClientPEMCa is the PEM encoded client certificate authority (if any)
	ClientPEMCa string
	// ServerPEMCert is the PEM encoded server certificate that we are
	// connecting to. It can be the empty string if we do not know the
	// server's certificate yet.
	ServerPEMCert string
}

ConnectInfo contains the information we need to connect to a specific LXD server

type RemoteConfig

type RemoteConfig struct {
	Addr     string `yaml:"addr"`
	Public   bool   `yaml:"public"`
	Protocol string `yaml:"protocol,omitempty"`
	Static   bool   `yaml:"-"`
}

RemoteConfig holds details for communication with a remote daemon.

Directories

Path Synopsis
Package lxd implements a client for the LXD API Overview This package lets you connect to LXD daemons or SimpleStream image servers over a Unix socket or HTTPs.
Package lxd implements a client for the LXD API Overview This package lets you connect to LXD daemons or SimpleStream image servers over a Unix socket or HTTPs.
lxc
lxd
* * This file is a bit funny.
* * This file is a bit funny.
That this code needs to exist is kind of dumb, but I'm not sure how else to do it.
That this code needs to exist is kind of dumb, but I'm not sure how else to do it.
api
Package api contains Go structs for all LXD API objects Overview This package has Go structs for every API object, all the various structs are named after the object they represent and some variations of those structs exist for initial object creation, object update and object retrieval.
Package api contains Go structs for all LXD API objects Overview This package has Go structs for every API object, all the various structs are named after the object they represent and some variations of those structs exist for initial object creation, object update and object retrieval.
cmd
gnuflag
Package gnuflag implements command-line flag parsing in the GNU style.
Package gnuflag implements command-line flag parsing in the GNU style.
test

Jump to

Keyboard shortcuts

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