Documentation ¶
Index ¶
- Constants
- Variables
- func ConfigValueSet(c *Cluster, key string, value string) error
- func ContainerConfigClear(tx *sql.Tx, id int) error
- func ContainerConfigInsert(tx *sql.Tx, id int, config map[string]string) error
- func ContainerProfilesInsert(tx *sql.Tx, id int, project string, profiles []string) error
- func ContainerUpdate(tx *sql.Tx, id int, description string, architecture int, ephemeral bool, ...) error
- func DevicesAdd(tx *sql.Tx, w string, cID int64, devices deviceConfig.Devices) error
- func InstanceSnapshotUpdate(tx *sql.Tx, id int, description string, expiryDate time.Time) error
- func NetworkConfigClear(tx *sql.Tx, networkID, nodeID int64) error
- func NetworkUpdateDescription(tx *sql.Tx, id int64, description string) error
- func NewTestDqliteServer(t *testing.T) (string, driver.NodeStore, func())
- func OpenNode(dir string, fresh func(*Node) error, legacyPatches map[int]*LegacyPatch) (*Node, *Dump, error)
- func ProfileConfigAdd(tx *sql.Tx, id int64, config map[string]string) error
- func ProfileConfigClear(tx *sql.Tx, id int64) error
- func ProfileDescriptionUpdate(tx *sql.Tx, id int64, description string) error
- func ProfileToAPI(profile *Profile) *api.Profile
- func ProfilesExpandConfig(config map[string]string, profiles []api.Profile) map[string]string
- func ProfilesExpandDevices(devices deviceConfig.Devices, profiles []api.Profile) deviceConfig.Devices
- func StoragePoolConfigClear(tx *sql.Tx, poolID, nodeID int64) error
- func StoragePoolUpdateDescription(tx *sql.Tx, id int64, description string) error
- func TxCommit(tx *sql.Tx) error
- type CertInfo
- type Cluster
- func (c *Cluster) Begin() (*sql.Tx, error)
- func (c *Cluster) CertDelete(fingerprint string) error
- func (c *Cluster) CertSave(cert *CertInfo) error
- func (c *Cluster) CertUpdate(fingerprint string, certName string, certType int) error
- func (c *Cluster) CertificateGet(fingerprint string) (cert *CertInfo, err error)
- func (c *Cluster) CertificatesGet() (certs []*CertInfo, err error)
- func (c *Cluster) Close() error
- func (c *Cluster) ContainerBackupID(name string) (int, error)
- func (c *Cluster) ContainerBackupRename(oldName, newName string) error
- func (c *Cluster) ContainerBackupsGetExpired() ([]InstanceBackupArgs, error)
- func (c *Cluster) ContainerConfig(id int) (map[string]string, error)
- func (c *Cluster) ContainerConfigGet(id int, key string) (string, error)
- func (c *Cluster) ContainerConfigRemove(id int, key string) error
- func (c *Cluster) ContainerGetBackup(project, name string) (InstanceBackupArgs, error)
- func (c *Cluster) ContainerGetBackups(project, name string) ([]string, error)
- func (c *Cluster) ContainerGetSnapshots(project, name string) ([]string, error)
- func (c *Cluster) ContainerNextSnapshot(project string, name string, pattern string) int
- func (c *Cluster) ContainerProfiles(id int) ([]string, error)
- func (c *Cluster) ContainerProjectAndName(id int) (string, string, error)
- func (c *Cluster) ContainerSetState(id int, state string) error
- func (c *Cluster) ContainerSetStateful(id int, stateful bool) error
- func (c *Cluster) ContainersNodeList(instanceType instancetype.Type) ([]string, error)
- func (c *Cluster) ContainersResetState() error
- func (c *Cluster) DB() *sql.DB
- func (c *Cluster) Devices(project, qName string, isprofile bool) (deviceConfig.Devices, error)
- func (c *Cluster) EnterExclusive() error
- func (c *Cluster) ExitExclusive(f func(*ClusterTx) error) error
- func (c *Cluster) GetNodeID() int64
- func (c *Cluster) ImageAliasAdd(project, name string, imageID int, desc string) error
- func (c *Cluster) ImageAliasDelete(project, name string) error
- func (c *Cluster) ImageAliasGet(project, name string, isTrustedClient bool) (int, api.ImageAliasesEntry, error)
- func (c *Cluster) ImageAliasRename(id int, name string) error
- func (c *Cluster) ImageAliasUpdate(id int, imageID int, desc string) error
- func (c *Cluster) ImageAliasesGet(project string) ([]string, error)
- func (c *Cluster) ImageAliasesMove(source int, destination int) error
- func (c *Cluster) ImageAssociateNode(project, fingerprint string) error
- func (c *Cluster) ImageCopyDefaultProfiles(id int, newID int) error
- func (c *Cluster) ImageDelete(id int) error
- func (c *Cluster) ImageExists(project string, fingerprint string) (bool, error)
- func (c *Cluster) ImageGet(project, fingerprint string, public bool, strictMatching bool) (int, *api.Image, error)
- func (c *Cluster) ImageGetFromAnyProject(fingerprint string) (int, *api.Image, error)
- func (c *Cluster) ImageGetNodesWithImage(fingerprint string) ([]string, error)
- func (c *Cluster) ImageGetNodesWithoutImage(fingerprint string) ([]string, error)
- func (c *Cluster) ImageGetPoolNamesFromIDs(poolIDs []int64) ([]string, error)
- func (c *Cluster) ImageGetPools(imageFingerprint string) ([]int64, error)
- func (c *Cluster) ImageInsert(project, fp string, fname string, sz int64, public bool, autoUpdate bool, ...) error
- func (c *Cluster) ImageIsReferencedByOtherProjects(project string, fingerprint string) (bool, error)
- func (c *Cluster) ImageLastAccessInit(fingerprint string) error
- func (c *Cluster) ImageLastAccessUpdate(fingerprint string, date time.Time) error
- func (c *Cluster) ImageLocate(fingerprint string) (string, error)
- func (c *Cluster) ImageSourceGet(imageID int) (int, api.ImageSource, error)
- func (c *Cluster) ImageSourceGetCachedFingerprint(server string, protocol string, alias string, typeName string, ...) (string, error)
- func (c *Cluster) ImageSourceInsert(id int, server string, protocol string, certificate string, alias string) error
- func (c *Cluster) ImageUpdate(id int, fname string, sz int64, public bool, autoUpdate bool, ...) error
- func (c *Cluster) ImageUploadedAt(id int, uploadedAt time.Time) error
- func (c *Cluster) ImagesGet(project string, public bool) ([]string, error)
- func (c *Cluster) ImagesGetByNodeID(id int64) (map[string][]string, error)
- func (c *Cluster) ImagesGetExpired(expiry int64) ([]ExpiredImage, error)
- func (c *Cluster) ImagesGetLocal() ([]string, error)
- func (c *Cluster) ImagesGetOnCurrentNode() (map[string][]string, error)
- func (c *Cluster) InstanceBackupCreate(args InstanceBackupArgs) error
- func (c *Cluster) InstanceBackupRemove(name string) error
- func (c *Cluster) InstanceID(project, name string) (int, error)
- func (c *Cluster) InstancePool(project, instanceName string) (string, error)
- func (c *Cluster) InstanceRemove(project, name string) error
- func (c *Cluster) InstanceSnapshotCreationUpdate(instanceID int, date time.Time) error
- func (c *Cluster) InstanceSnapshotID(project, instance, name string) (int, error)
- func (c *Cluster) LegacyContainersList() ([]string, error)
- func (c *Cluster) LegacySnapshotsList() ([]string, error)
- func (c *Cluster) NetworkConfigGet(id int64) (map[string]string, error)
- func (c *Cluster) NetworkCreate(name, description string, config map[string]string) (int64, error)
- func (c *Cluster) NetworkDelete(name string) error
- func (c *Cluster) NetworkGet(name string) (int64, *api.Network, error)
- func (c *Cluster) NetworkGetInterface(devName string) (int64, *api.Network, error)
- func (c *Cluster) NetworkRename(oldName string, newName string) error
- func (c *Cluster) NetworkUpdate(name, description string, config map[string]string) error
- func (c *Cluster) Networks() ([]string, error)
- func (c *Cluster) NetworksNotPending() ([]string, error)
- func (c *Cluster) NodeID(id int64)
- func (c *Cluster) ProfileCleanupLeftover() error
- func (c *Cluster) ProfileConfig(project, name string) (map[string]string, error)
- func (c *Cluster) ProfileContainersGet(project, profile string) (map[string][]string, error)
- func (c *Cluster) ProfileGet(project, name string) (int64, *api.Profile, error)
- func (c *Cluster) Profiles(project string) ([]string, error)
- func (c *Cluster) ProfilesGet(project string, names []string) ([]api.Profile, error)
- func (c *Cluster) SetDefaultTimeout(timeout time.Duration)
- func (c *Cluster) StoragePoolConfigGet(poolID int64) (map[string]string, error)
- func (c *Cluster) StoragePoolCreate(poolName string, poolDescription string, poolDriver string, ...) (int64, error)
- func (c *Cluster) StoragePoolDelete(poolName string) (*api.StoragePool, error)
- func (c *Cluster) StoragePoolGet(poolName string) (int64, *api.StoragePool, error)
- func (c *Cluster) StoragePoolGetID(poolName string) (int64, error)
- func (c *Cluster) StoragePoolInsertZfsDriver() error
- func (c *Cluster) StoragePoolNodeVolumeGetTypeByProject(project, volumeName string, volumeType int, poolID int64) (int64, *api.StorageVolume, error)
- func (c *Cluster) StoragePoolNodeVolumeGetTypeIDByProject(projectName string, volumeName string, volumeType int, poolID int64) (int64, error)
- func (c *Cluster) StoragePoolNodeVolumesGet(project string, poolID int64, volumeTypes []int) ([]*api.StorageVolume, error)
- func (c *Cluster) StoragePoolNodeVolumesGetType(projectName string, volumeType int, poolID int64) ([]string, error)
- func (c *Cluster) StoragePoolUpdate(poolName, description string, poolConfig map[string]string) error
- func (c *Cluster) StoragePoolVolumeCreate(project, volumeName, volumeDescription string, volumeType int, poolID int64, ...) (int64, error)
- func (c *Cluster) StoragePoolVolumeDelete(project, volumeName string, volumeType int, poolID int64) error
- func (c *Cluster) StoragePoolVolumeRename(project, oldVolumeName string, newVolumeName string, volumeType int, ...) error
- func (c *Cluster) StoragePoolVolumeSnapshotCreate(project, volumeName, volumeDescription string, volumeType int, poolID int64, ...) (int64, error)
- func (c *Cluster) StoragePoolVolumeSnapshotUpdateByProject(project, volumeName string, volumeType int, poolID int64, ...) error
- func (c *Cluster) StoragePoolVolumeSnapshotsGetType(projectName string, volumeName string, volumeType int, poolID int64) ([]StorageVolumeArgs, error)
- func (c *Cluster) StoragePoolVolumeUpdateByProject(project, volumeName string, volumeType int, poolID int64, ...) error
- func (c *Cluster) StoragePoolVolumesGet(project string, poolID int64, volumeTypes []int) ([]*api.StorageVolume, error)
- func (c *Cluster) StoragePoolVolumesGetAllByType(volumeType int) ([]StorageVolumeArgs, error)
- func (c *Cluster) StoragePoolVolumesGetNames(poolID int64) ([]string, error)
- func (c *Cluster) StoragePools() ([]string, error)
- func (c *Cluster) StoragePoolsGetDrivers() ([]string, error)
- func (c *Cluster) StoragePoolsNotPending() ([]string, error)
- func (c *Cluster) StorageVolumeCleanupImages(fingerprints []string) error
- func (c *Cluster) StorageVolumeDescriptionGet(volumeID int64) (string, error)
- func (c *Cluster) StorageVolumeIsAvailable(pool, volume string) (bool, error)
- func (c *Cluster) StorageVolumeMoveToLVMThinPoolNameKey() error
- func (c *Cluster) StorageVolumeNextSnapshot(name string, typ int, pattern string) int
- func (c *Cluster) StorageVolumeSnapshotExpiryGet(volumeID int64) (time.Time, error)
- func (c *Cluster) StorageVolumeSnapshotsGetExpired() ([]StorageVolumeArgs, error)
- func (c *Cluster) Transaction(f func(*ClusterTx) error) error
- type ClusterRole
- type ClusterTx
- func (c *ClusterTx) Config() (map[string]string, error)
- func (c *ClusterTx) ContainerConfigInsert(id int, config map[string]string) error
- func (c *ClusterTx) ContainerConfigUpdate(id int, values map[string]string) error
- func (c *ClusterTx) ContainerGetSnapshotsFull(project string, name string) ([]Instance, error)
- func (c *ClusterTx) ContainerLastUsedUpdate(id int, date time.Time) error
- func (c *ClusterTx) ContainerNodeAddress(project string, name string, instanceType instancetype.Type) (string, error)
- func (c *ClusterTx) ContainerNodeMove(project, oldName, newName, newNode string) error
- func (c *ClusterTx) ContainerNodeProjectList(project string, instanceType instancetype.Type) ([]Instance, error)
- func (c *ClusterTx) ContainerSetState(id int, state string) error
- func (c *ClusterTx) ContainersByNodeName(project string, instanceType instancetype.Type) (map[string]string, error)
- func (c *ClusterTx) ContainersListByNodeAddress(project string, instanceType instancetype.Type) (map[string][]string, error)
- func (c *ClusterTx) InstanceConfigRef(filter InstanceFilter) (map[string]map[string]map[string]string, error)
- func (c *ClusterTx) InstanceCreate(object Instance) (int64, error)
- func (c *ClusterTx) InstanceDelete(project string, name string) error
- func (c *ClusterTx) InstanceDevicesRef(filter InstanceFilter) (map[string]map[string]map[string]map[string]string, error)
- func (c *ClusterTx) InstanceExists(project string, name string) (bool, error)
- func (c *ClusterTx) InstanceGet(project string, name string) (*Instance, error)
- func (c *ClusterTx) InstanceID(project string, name string) (int64, error)
- func (c *ClusterTx) InstanceList(filter InstanceFilter) ([]Instance, error)
- func (c *ClusterTx) InstanceNames(project string) ([]string, error)
- func (c *ClusterTx) InstancePool(project, instanceName string) (string, error)
- func (c *ClusterTx) InstanceProfilesRef(filter InstanceFilter) (map[string]map[string][]string, error)
- func (c *ClusterTx) InstanceRename(project string, name string, to string) error
- func (c *ClusterTx) InstanceSnapshotConfigRef(filter InstanceSnapshotFilter) (map[string]map[string]map[string]map[string]string, error)
- func (c *ClusterTx) InstanceSnapshotConfigUpdate(id int, values map[string]string) error
- func (c *ClusterTx) InstanceSnapshotCreate(object InstanceSnapshot) (int64, error)
- func (c *ClusterTx) InstanceSnapshotDelete(project string, instance string, name string) error
- func (c *ClusterTx) InstanceSnapshotDevicesRef(filter InstanceSnapshotFilter) (map[string]map[string]map[string]map[string]map[string]string, error)
- func (c *ClusterTx) InstanceSnapshotExists(project string, instance string, name string) (bool, error)
- func (c *ClusterTx) InstanceSnapshotGet(project string, instance string, name string) (*InstanceSnapshot, error)
- func (c *ClusterTx) InstanceSnapshotID(project string, instance string, name string) (int64, error)
- func (c *ClusterTx) InstanceSnapshotList(filter InstanceSnapshotFilter) ([]InstanceSnapshot, error)
- func (c *ClusterTx) InstanceSnapshotRename(project string, instance string, name string, to string) error
- func (c *ClusterTx) NetworkConfigAdd(networkID, nodeID int64, config map[string]string) error
- func (c *ClusterTx) NetworkCreatePending(node, name string, conf map[string]string) error
- func (c *ClusterTx) NetworkCreated(name string) error
- func (c *ClusterTx) NetworkErrored(name string) error
- func (c *ClusterTx) NetworkID(name string) (int64, error)
- func (c *ClusterTx) NetworkIDsNotPending() (map[string]int64, error)
- func (c *ClusterTx) NetworkNodeConfigs(networkID int64) (map[string]map[string]string, error)
- func (c *ClusterTx) NetworkNodeJoin(networkID, nodeID int64) error
- func (c *ClusterTx) NetworksNodeConfig() (map[string]map[string]string, error)
- func (c *ClusterTx) NodeAdd(name string, address string) (int64, error)
- func (c *ClusterTx) NodeAddRole(id int64, role ClusterRole) error
- func (c *ClusterTx) NodeAddWithArch(name string, address string, arch int) (int64, error)
- func (c *ClusterTx) NodeAddress() (string, error)
- func (c *ClusterTx) NodeByAddress(address string) (NodeInfo, error)
- func (c *ClusterTx) NodeByName(name string) (NodeInfo, error)
- func (c *ClusterTx) NodeClear(id int64) error
- func (c *ClusterTx) NodeHeartbeat(address string, heartbeat time.Time) error
- func (c *ClusterTx) NodeID(id int64)
- func (c *ClusterTx) NodeIsEmpty(id int64) (string, error)
- func (c *ClusterTx) NodeIsOutdated() (bool, error)
- func (c *ClusterTx) NodeName() (string, error)
- func (c *ClusterTx) NodeOfflineThreshold() (time.Duration, error)
- func (c *ClusterTx) NodePending(id int64, pending bool) error
- func (c *ClusterTx) NodePendingByAddress(address string) (NodeInfo, error)
- func (c *ClusterTx) NodeRemove(id int64) error
- func (c *ClusterTx) NodeRemoveRole(id int64, role ClusterRole) error
- func (c *ClusterTx) NodeRename(old, new string) error
- func (c *ClusterTx) NodeUpdate(id int64, name string, address string) error
- func (c *ClusterTx) NodeUpdateRoles(id int64, roles []ClusterRole) error
- func (c *ClusterTx) NodeUpdateVersion(id int64, version [2]int) error
- func (c *ClusterTx) NodeWithLeastContainers(archs []int) (string, error)
- func (c *ClusterTx) Nodes() ([]NodeInfo, error)
- func (c *ClusterTx) NodesCount() (int, error)
- func (c *ClusterTx) OperationAdd(project, uuid string, typ OperationType) (int64, error)
- func (c *ClusterTx) OperationByUUID(uuid string) (Operation, error)
- func (c *ClusterTx) OperationFlush(nodeID int64) error
- func (c *ClusterTx) OperationNodes(project string) ([]string, error)
- func (c *ClusterTx) OperationRemove(uuid string) error
- func (c *ClusterTx) Operations() ([]Operation, error)
- func (c *ClusterTx) OperationsUUIDs() ([]string, error)
- func (c *ClusterTx) ProfileConfigRef(filter ProfileFilter) (map[string]map[string]map[string]string, error)
- func (c *ClusterTx) ProfileCreate(object Profile) (int64, error)
- func (c *ClusterTx) ProfileDelete(project string, name string) error
- func (c *ClusterTx) ProfileDevicesRef(filter ProfileFilter) (map[string]map[string]map[string]map[string]string, error)
- func (c *ClusterTx) ProfileExists(project string, name string) (bool, error)
- func (c *ClusterTx) ProfileGet(project string, name string) (*Profile, error)
- func (c *ClusterTx) ProfileID(project string, name string) (int64, error)
- func (c *ClusterTx) ProfileList(filter ProfileFilter) ([]Profile, error)
- func (c *ClusterTx) ProfileRename(project string, name string, to string) error
- func (c *ClusterTx) ProfileURIs(filter ProfileFilter) ([]string, error)
- func (c *ClusterTx) ProfileUsedByRef(filter ProfileFilter) (map[string]map[string][]string, error)
- func (c *ClusterTx) ProjectConfigRef(filter ProjectFilter) (map[string]map[string]string, error)
- func (c *ClusterTx) ProjectCreate(object api.ProjectsPost) (int64, error)
- func (c *ClusterTx) ProjectDelete(name string) error
- func (c *ClusterTx) ProjectExists(name string) (bool, error)
- func (c *ClusterTx) ProjectGet(name string) (*api.Project, error)
- func (c *ClusterTx) ProjectHasImages(name string) (bool, error)
- func (c *ClusterTx) ProjectHasProfiles(name string) (bool, error)
- func (c *ClusterTx) ProjectID(name string) (int64, error)
- func (c *ClusterTx) ProjectLaunchWithoutImages(project string) error
- func (c *ClusterTx) ProjectList(filter ProjectFilter) ([]api.Project, error)
- func (c *ClusterTx) ProjectMap() (map[int64]string, error)
- func (c *ClusterTx) ProjectNames() ([]string, error)
- func (c *ClusterTx) ProjectRename(name string, to string) error
- func (c *ClusterTx) ProjectURIs(filter ProjectFilter) ([]string, error)
- func (c *ClusterTx) ProjectUpdate(name string, object api.ProjectPut) error
- func (c *ClusterTx) ProjectUsedByRef(filter ProjectFilter) (map[string][]string, error)
- func (c *ClusterTx) StoragePoolConfigAdd(poolID, nodeID int64, config map[string]string) error
- func (c *ClusterTx) StoragePoolCreatePending(node, name, driver string, conf map[string]string) error
- func (c *ClusterTx) StoragePoolCreated(name string) error
- func (c *ClusterTx) StoragePoolDriver(id int64) (string, error)
- func (c *ClusterTx) StoragePoolErrored(name string) error
- func (c *ClusterTx) StoragePoolID(name string) (int64, error)
- func (c *ClusterTx) StoragePoolIDsNotPending() (map[string]int64, error)
- func (c *ClusterTx) StoragePoolNodeConfigs(poolID int64) (map[string]map[string]string, error)
- func (c *ClusterTx) StoragePoolNodeJoin(poolID, nodeID int64) error
- func (c *ClusterTx) StoragePoolNodeJoinCeph(poolID, nodeID int64) error
- func (c *ClusterTx) StoragePoolsNodeConfig() (map[string]map[string]string, error)
- func (c *ClusterTx) StorageVolumeNodeAddresses(poolID int64, project, name string, typ int) ([]string, error)
- func (c *ClusterTx) UpdateConfig(values map[string]string) error
- type Dump
- type ExpiredImage
- type Instance
- type InstanceArgs
- type InstanceBackupArgs
- type InstanceFilter
- type InstanceSnapshot
- type InstanceSnapshotFilter
- type LegacyPatch
- type Node
- type NodeInfo
- type NodeTx
- func (n *NodeTx) Config() (map[string]string, error)
- func (n *NodeTx) RaftNodeAdd(address string) (int64, error)
- func (n *NodeTx) RaftNodeAddress(id int64) (string, error)
- func (n *NodeTx) RaftNodeAddresses() ([]string, error)
- func (n *NodeTx) RaftNodeDelete(id int64) error
- func (n *NodeTx) RaftNodeFirst(address string) error
- func (n *NodeTx) RaftNodes() ([]RaftNode, error)
- func (n *NodeTx) RaftNodesReplace(nodes []RaftNode) error
- func (n *NodeTx) Tx() *sql.Tx
- func (n *NodeTx) UpdateConfig(values map[string]string) error
- type Operation
- type OperationType
- type Profile
- type ProfileFilter
- type ProjectFilter
- type RaftNode
- type RaftRole
- type StorageVolumeArgs
Constants ¶
const ( RaftVoter = client.Voter RaftStandBy = client.StandBy RaftSpare = client.Spare )
RaftNode roles.
const ( StoragePoolVolumeTypeContainer = iota StoragePoolVolumeTypeImage StoragePoolVolumeTypeCustom StoragePoolVolumeTypeVM )
XXX: this was extracted from lxd/storage_volume_utils.go, we find a way to
factor it independently from both the db and main packages.
const ( StoragePoolVolumeTypeNameContainer string = "container" StoragePoolVolumeTypeNameVM string = "virtual-machine" StoragePoolVolumeTypeNameImage string = "image" StoragePoolVolumeTypeNameCustom string = "custom" )
Leave the string type in here! This guarantees that go treats this is as a typed string constant. Removing it causes go to treat these as untyped string constants which is not what we want.
const ClusterRoleDatabase = ClusterRole("database")
ClusterRoleDatabase represents the database role in a cluster.
const DefaultOfflineThreshold = 20
DefaultOfflineThreshold is the default value for the cluster.offline_threshold configuration key, expressed in seconds.
Variables ¶
var ( // ErrAlreadyDefined hapens when the given entry already exists, // for example a container. ErrAlreadyDefined = fmt.Errorf("The instance/snapshot already exists") // ErrNoSuchObject is in the case of joins (and probably other) queries, // we don't get back sql.ErrNoRows when no rows are returned, even though we do // on selects without joins. Instead, you can use this error to // propagate up and generate proper 404s to the client when something // isn't found so we don't abuse sql.ErrNoRows any more than we // already do. ErrNoSuchObject = fmt.Errorf("No such object") )
var ClusterRoles = map[int]ClusterRole{ 0: ClusterRoleDatabase, }
ClusterRoles maps role ids into human-readable names.
var ErrSomeNodesAreBehind = fmt.Errorf("some nodes are behind this node's version")
ErrSomeNodesAreBehind is returned by OpenCluster if some of the nodes in the cluster have a schema or API version that is less recent than this node.
var ImageSourceProtocol = map[int]string{
0: "lxd",
1: "direct",
2: "simplestreams",
}
ImageSourceProtocol maps image source protocol codes to human-readable names.
var NetworkNodeConfigKeys = []string{
"bridge.external_interfaces",
}
NetworkNodeConfigKeys lists all network config keys which are node-specific.
var StoragePoolNodeConfigKeys = []string{
"size",
"source",
"volatile.initial_source",
"zfs.pool_name",
"lvm.thinpool",
"lvm.vg_name",
}
StoragePoolNodeConfigKeys lists all storage pool config keys which are node-specific.
Functions ¶
func ConfigValueSet ¶
ConfigValueSet is a convenience to set a cluster-level key/value config pair in a single transaction.
func ContainerConfigClear ¶
ContainerConfigClear removes any config associated with the container with the given ID.
func ContainerConfigInsert ¶
ContainerConfigInsert inserts a new config for the container with the given ID.
func ContainerProfilesInsert ¶
ContainerProfilesInsert associates the container with the given ID with the profiles with the given names in the given project.
func ContainerUpdate ¶
func ContainerUpdate(tx *sql.Tx, id int, description string, architecture int, ephemeral bool, expiryDate time.Time) error
ContainerUpdate updates the description, architecture and ephemeral flag of the container with the given ID.
func DevicesAdd ¶
DevicesAdd adds a new device.
func InstanceSnapshotUpdate ¶
InstanceSnapshotUpdate updates the description and expiry date of the instance snapshot with the given ID.
func NetworkConfigClear ¶
NetworkConfigClear resets the config of the network with the given ID associated with the node with the given ID.
func NetworkUpdateDescription ¶
NetworkUpdateDescription updates the description of the network with the given ID.
func NewTestDqliteServer ¶
NewTestDqliteServer creates a new test dqlite server.
Return the directory backing the test server and a newly created server store that can be used to connect to it.
func OpenNode ¶
func OpenNode(dir string, fresh func(*Node) error, legacyPatches map[int]*LegacyPatch) (*Node, *Dump, error)
OpenNode creates a new Node object.
The fresh hook parameter is used by the daemon to mark all known patch names as applied when a brand new database is created.
The legacyPatches parameter is used as a mean to apply the legacy V10, V11, V15, V29 and V30 non-db updates during the database upgrade sequence, to avoid any change in semantics wrt the old logic (see PR #3322).
Return the newly created Node object, and a Dump of the pre-clustering data if we've migrating to a cluster-aware version.
func ProfileConfigAdd ¶
ProfileConfigAdd adds a config to the profile with the given ID.
func ProfileConfigClear ¶
ProfileConfigClear resets the config of the profile with the given ID.
func ProfileDescriptionUpdate ¶
ProfileDescriptionUpdate updates the description of the profile with the given ID.
func ProfileToAPI ¶
ProfileToAPI is a convenience to convert a Profile db struct into an API profile struct.
func ProfilesExpandConfig ¶
ProfilesExpandConfig expands the given container config with the config values of the given profiles.
func ProfilesExpandDevices ¶
func ProfilesExpandDevices(devices deviceConfig.Devices, profiles []api.Profile) deviceConfig.Devices
ProfilesExpandDevices expands the given container devices with the devices defined in the given profiles.
func StoragePoolConfigClear ¶
StoragePoolConfigClear deletes the storage pool config.
func StoragePoolUpdateDescription ¶
StoragePoolUpdateDescription updates the storage pool description.
Types ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster mediates access to LXD's data stored in the cluster dqlite database.
func ForLocalInspection ¶
ForLocalInspection is a aid for the hack in initializeDbObject, which sets the db-related Deamon attributes upfront, to be backward compatible with the legacy patches that need to interact with the database.
func ForLocalInspectionWithPreparedStmts ¶
ForLocalInspectionWithPreparedStmts is the same as ForLocalInspection but it also prepares the statements used in auto-generated database code.
func NewTestCluster ¶
NewTestCluster creates a new Cluster for testing purposes, along with a function that can be used to clean it up when done.
func OpenCluster ¶
func OpenCluster(name string, store driver.NodeStore, address, dir string, timeout time.Duration, dump *Dump, options ...driver.Option) (*Cluster, error)
OpenCluster creates a new Cluster object for interacting with the dqlite database.
- name: Basename of the database file holding the data. Typically "db.bin". - dialer: Function used to connect to the dqlite backend via gRPC SQL. - address: Network address of this node (or empty string). - dir: Base LXD database directory (e.g. /var/lib/lxd/database) - timeout: Give up trying to open the database after this amount of time. - dump: If not nil, a copy of 2.0 db data, for migrating to 3.0.
The address and api parameters will be used to determine if the cluster database matches our version, and possibly trigger a schema update. If the schema update can't be performed right now, because some nodes are still behind, an Upgrading error is returned.
func (*Cluster) CertDelete ¶
CertDelete deletes a certificate from the db.
func (*Cluster) CertSave ¶
CertSave stores a CertBaseInfo object in the db, it will ignore the ID field from the CertInfo.
func (*Cluster) CertUpdate ¶
CertUpdate updates the certificate with the given fingerprint.
func (*Cluster) CertificateGet ¶
CertificateGet gets an CertBaseInfo object from the database. The argument fingerprint will be queried with a LIKE query, means you can pass a shortform and will get the full fingerprint. There can never be more than one image with a given fingerprint, as it is enforced by a UNIQUE constraint in the schema.
func (*Cluster) CertificatesGet ¶
CertificatesGet returns all certificates from the DB as CertBaseInfo objects.
func (*Cluster) ContainerBackupID ¶
ContainerBackupID returns the ID of the container backup with the given name.
func (*Cluster) ContainerBackupRename ¶
ContainerBackupRename renames a container backup from the given current name to the new one.
func (*Cluster) ContainerBackupsGetExpired ¶
func (c *Cluster) ContainerBackupsGetExpired() ([]InstanceBackupArgs, error)
ContainerBackupsGetExpired returns a list of expired container backups.
func (*Cluster) ContainerConfig ¶
ContainerConfig gets the container configuration map from the DB
func (*Cluster) ContainerConfigGet ¶
ContainerConfigGet returns the value of the given key in the configuration of the container with the given ID.
func (*Cluster) ContainerConfigRemove ¶
ContainerConfigRemove removes the given key from the config of the container with the given ID.
func (*Cluster) ContainerGetBackup ¶
func (c *Cluster) ContainerGetBackup(project, name string) (InstanceBackupArgs, error)
ContainerGetBackup returns the backup with the given name.
func (*Cluster) ContainerGetBackups ¶
ContainerGetBackups returns the names of all backups of the container with the given name.
func (*Cluster) ContainerGetSnapshots ¶
ContainerGetSnapshots returns the names of all snapshots of the container in the given project with the given name.
func (*Cluster) ContainerNextSnapshot ¶
ContainerNextSnapshot returns the index the next snapshot of the container with the given name and pattern should have.
func (*Cluster) ContainerProfiles ¶
ContainerProfiles returns a list of profiles for a given container ID.
func (*Cluster) ContainerProjectAndName ¶
ContainerProjectAndName returns the project and the name of the container with the given ID.
func (*Cluster) ContainerSetState ¶
ContainerSetState sets the the power state of the container with the given ID.
func (*Cluster) ContainerSetStateful ¶
ContainerSetStateful toggles the stateful flag of the container with the given ID.
func (*Cluster) ContainersNodeList ¶
func (c *Cluster) ContainersNodeList(instanceType instancetype.Type) ([]string, error)
ContainersNodeList returns the names of all the containers of the given type running on the local node.
func (*Cluster) ContainersResetState ¶
ContainersResetState resets the power state of all containers.
func (*Cluster) DB ¶
DB returns the low level database handle to the cluster database.
FIXME: this is used for compatibility with some legacy code, and should be
dropped once there are no call sites left.
func (*Cluster) EnterExclusive ¶
EnterExclusive acquires a lock on the cluster db, so any successive call to Transaction will block until ExitExclusive has been called.
func (*Cluster) ExitExclusive ¶
ExitExclusive runs the given transaction and then releases the lock acquired with EnterExclusive.
func (*Cluster) ImageAliasAdd ¶
ImageAliasAdd inserts an alias ento the database.
func (*Cluster) ImageAliasDelete ¶
ImageAliasDelete deletes the alias with the given name.
func (*Cluster) ImageAliasGet ¶
func (c *Cluster) ImageAliasGet(project, name string, isTrustedClient bool) (int, api.ImageAliasesEntry, error)
ImageAliasGet returns the alias with the given name in the given project.
func (*Cluster) ImageAliasRename ¶
ImageAliasRename renames the alias with the given ID.
func (*Cluster) ImageAliasUpdate ¶
ImageAliasUpdate updates the alias with the given ID.
func (*Cluster) ImageAliasesGet ¶
ImageAliasesGet returns the names of the aliases of all images.
func (*Cluster) ImageAliasesMove ¶
ImageAliasesMove changes the image ID associated with an alias.
func (*Cluster) ImageAssociateNode ¶
ImageAssociateNode creates a new entry in the images_nodes table for tracking that the current node has the given image.
func (*Cluster) ImageCopyDefaultProfiles ¶
ImageCopyDefaultProfiles copies default profiles from id to new_id.
func (*Cluster) ImageDelete ¶
ImageDelete deletes the image with the given ID.
func (*Cluster) ImageExists ¶
ImageExists returns whether an image with the given fingerprint exists.
func (*Cluster) ImageGet ¶
func (c *Cluster) ImageGet(project, fingerprint string, public bool, strictMatching bool) (int, *api.Image, error)
ImageGet gets an Image object from the database. If strictMatching is false, The fingerprint argument will be queried with a LIKE query, means you can pass a shortform and will get the full fingerprint. There can never be more than one image with a given fingerprint, as it is enforced by a UNIQUE constraint in the schema.
func (*Cluster) ImageGetFromAnyProject ¶
ImageGetFromAnyProject returns an image matching the given fingerprint, if it exists in any project.
func (*Cluster) ImageGetNodesWithImage ¶
ImageGetNodesWithImage returns the addresses of online nodes which already have the image.
func (*Cluster) ImageGetNodesWithoutImage ¶
ImageGetNodesWithoutImage returns the addresses of online nodes which don't have the image.
func (*Cluster) ImageGetPoolNamesFromIDs ¶
ImageGetPoolNamesFromIDs get the names of all storage pools on which a given image exists.
func (*Cluster) ImageGetPools ¶
ImageGetPools get the names of all storage pools on which a given image exists.
func (*Cluster) ImageInsert ¶
func (c *Cluster) ImageInsert(project, fp string, fname string, sz int64, public bool, autoUpdate bool, architecture string, createdAt time.Time, expiresAt time.Time, properties map[string]string, typeName string) error
ImageInsert inserts a new image.
func (*Cluster) ImageIsReferencedByOtherProjects ¶
func (c *Cluster) ImageIsReferencedByOtherProjects(project string, fingerprint string) (bool, error)
ImageIsReferencedByOtherProjects returns true if the image with the given fingerprint is referenced by projects other than the given one.
func (*Cluster) ImageLastAccessInit ¶
ImageLastAccessInit inits the last_use_date field of the image with the given fingerprint.
func (*Cluster) ImageLastAccessUpdate ¶
ImageLastAccessUpdate updates the last_use_date field of the image with the given fingerprint.
func (*Cluster) ImageLocate ¶
ImageLocate returns the address of an online node that has a local copy of the given image, or an empty string if the image is already available on this node.
If the image is not available on any online node, an error is returned.
func (*Cluster) ImageSourceGet ¶
ImageSourceGet returns the image source with the given ID.
func (*Cluster) ImageSourceGetCachedFingerprint ¶
func (c *Cluster) ImageSourceGetCachedFingerprint(server string, protocol string, alias string, typeName string, architecture int) (string, error)
ImageSourceGetCachedFingerprint tries to find a source entry of a locally cached image that matches the given remote details (server, protocol and alias). Return the fingerprint linked to the matching entry, if any.
func (*Cluster) ImageSourceInsert ¶
func (c *Cluster) ImageSourceInsert(id int, server string, protocol string, certificate string, alias string) error
ImageSourceInsert inserts a new image source.
func (*Cluster) ImageUpdate ¶
func (c *Cluster) ImageUpdate(id int, fname string, sz int64, public bool, autoUpdate bool, architecture string, createdAt time.Time, expiresAt time.Time, properties map[string]string, project string, profileIds []int64) error
ImageUpdate updates the image with the given ID.
func (*Cluster) ImageUploadedAt ¶
ImageUploadedAt updates the upload_date column and an image row.
func (*Cluster) ImagesGet ¶
ImagesGet returns the names of all images (optionally only the public ones).
func (*Cluster) ImagesGetByNodeID ¶
ImagesGetByNodeID returns all images that the LXD node instance has with the given node id.
func (*Cluster) ImagesGetExpired ¶
func (c *Cluster) ImagesGetExpired(expiry int64) ([]ExpiredImage, error)
ImagesGetExpired returns the names and project name of all images that have expired since the given time.
func (*Cluster) ImagesGetLocal ¶
ImagesGetLocal returns the names of all local images.
func (*Cluster) ImagesGetOnCurrentNode ¶
ImagesGetOnCurrentNode returns all images that the current LXD node instance has.
func (*Cluster) InstanceBackupCreate ¶
func (c *Cluster) InstanceBackupCreate(args InstanceBackupArgs) error
InstanceBackupCreate creates a new backup.
func (*Cluster) InstanceBackupRemove ¶
InstanceBackupRemove removes the container backup with the given name from the database.
func (*Cluster) InstanceID ¶
InstanceID returns the ID of the instance with the given name.
func (*Cluster) InstancePool ¶
InstancePool returns the storage pool of a given instance.
This is a non-transactional variant of ClusterTx.InstancePool().
func (*Cluster) InstanceRemove ¶
InstanceRemove removes the instance with the given name from the database.
func (*Cluster) InstanceSnapshotCreationUpdate ¶
InstanceSnapshotCreationUpdate updates the creation_date field of the instance snapshot with ID.
func (*Cluster) InstanceSnapshotID ¶
InstanceSnapshotID returns the ID of the snapshot with the given name.
func (*Cluster) LegacyContainersList ¶
LegacyContainersList returns the names of all the containers.
NOTE: this is a pre-projects legacy API that is used only by patches. Don't use it for new code.
func (*Cluster) LegacySnapshotsList ¶
LegacySnapshotsList returns the names of all the snapshots.
NOTE: this is a pre-projects legacy API that is used only by patches. Don't use it for new code.
func (*Cluster) NetworkConfigGet ¶
NetworkConfigGet returns the config map of the network with the given ID.
func (*Cluster) NetworkCreate ¶
NetworkCreate creates a new network.
func (*Cluster) NetworkDelete ¶
NetworkDelete deletes the network with the given name.
func (*Cluster) NetworkGet ¶
NetworkGet returns the network with the given name.
func (*Cluster) NetworkGetInterface ¶
NetworkGetInterface returns the network associated with the interface with the given name.
func (*Cluster) NetworkRename ¶
NetworkRename renames a network.
func (*Cluster) NetworkUpdate ¶
NetworkUpdate updates the network with the given name.
func (*Cluster) NetworksNotPending ¶
NetworksNotPending returns the names of all networks that are not pending.
func (*Cluster) NodeID ¶
NodeID sets the the node NodeID associated with this cluster instance. It's used for backward-compatibility of all db-related APIs that were written before clustering and don't accept a node NodeID, so in those cases we automatically use this value as implicit node NodeID.
func (*Cluster) ProfileCleanupLeftover ¶
ProfileCleanupLeftover removes unreferenced profiles.
func (*Cluster) ProfileConfig ¶
ProfileConfig gets the profile configuration map from the DB.
func (*Cluster) ProfileContainersGet ¶
ProfileContainersGet gets the names of the containers associated with the profile with the given name.
func (*Cluster) ProfileGet ¶
ProfileGet returns the profile with the given name.
func (*Cluster) ProfilesGet ¶
ProfilesGet returns the profiles with the given names in the given project.
func (*Cluster) SetDefaultTimeout ¶
SetDefaultTimeout sets the default go-dqlite driver timeout.
func (*Cluster) StoragePoolConfigGet ¶
StoragePoolConfigGet returns the config of a storage pool.
func (*Cluster) StoragePoolCreate ¶
func (c *Cluster) StoragePoolCreate(poolName string, poolDescription string, poolDriver string, poolConfig map[string]string) (int64, error)
StoragePoolCreate creates new storage pool.
func (*Cluster) StoragePoolDelete ¶
func (c *Cluster) StoragePoolDelete(poolName string) (*api.StoragePool, error)
StoragePoolDelete deletes storage pool.
func (*Cluster) StoragePoolGet ¶
StoragePoolGet returns a single storage pool.
func (*Cluster) StoragePoolGetID ¶
StoragePoolGetID returns the id of a single storage pool.
func (*Cluster) StoragePoolInsertZfsDriver ¶
StoragePoolInsertZfsDriver replaces the driver of all storage pools without a driver, setting it to 'zfs'.
func (*Cluster) StoragePoolNodeVolumeGetTypeByProject ¶
func (c *Cluster) StoragePoolNodeVolumeGetTypeByProject(project, volumeName string, volumeType int, poolID int64) (int64, *api.StorageVolume, error)
StoragePoolNodeVolumeGetTypeByProject gets a single storage volume attached to a given storage pool of a given type, on the current node in the given project.
func (*Cluster) StoragePoolNodeVolumeGetTypeIDByProject ¶
func (c *Cluster) StoragePoolNodeVolumeGetTypeIDByProject(projectName string, volumeName string, volumeType int, poolID int64) (int64, error)
StoragePoolNodeVolumeGetTypeIDByProject gets the ID of a storage volume on a given storage pool of a given storage volume type and project, on the current node.
func (*Cluster) StoragePoolNodeVolumesGet ¶
func (c *Cluster) StoragePoolNodeVolumesGet(project string, poolID int64, volumeTypes []int) ([]*api.StorageVolume, error)
StoragePoolNodeVolumesGet returns all storage volumes attached to a given storage pool on the current node.
func (*Cluster) StoragePoolNodeVolumesGetType ¶
func (c *Cluster) StoragePoolNodeVolumesGetType(projectName string, volumeType int, poolID int64) ([]string, error)
StoragePoolNodeVolumesGetType returns all storage volumes attached to a given storage pool of a given volume type, on the current node.
func (*Cluster) StoragePoolUpdate ¶
func (c *Cluster) StoragePoolUpdate(poolName, description string, poolConfig map[string]string) error
StoragePoolUpdate updates a storage pool.
func (*Cluster) StoragePoolVolumeCreate ¶
func (c *Cluster) StoragePoolVolumeCreate(project, volumeName, volumeDescription string, volumeType int, poolID int64, volumeConfig map[string]string) (int64, error)
StoragePoolVolumeCreate creates a new storage volume attached to a given storage pool.
func (*Cluster) StoragePoolVolumeDelete ¶
func (c *Cluster) StoragePoolVolumeDelete(project, volumeName string, volumeType int, poolID int64) error
StoragePoolVolumeDelete deletes the storage volume attached to a given storage pool.
func (*Cluster) StoragePoolVolumeRename ¶
func (c *Cluster) StoragePoolVolumeRename(project, oldVolumeName string, newVolumeName string, volumeType int, poolID int64) error
StoragePoolVolumeRename renames the storage volume attached to a given storage pool.
func (*Cluster) StoragePoolVolumeSnapshotCreate ¶
func (c *Cluster) StoragePoolVolumeSnapshotCreate(project, volumeName, volumeDescription string, volumeType int, poolID int64, volumeConfig map[string]string, expiryDate time.Time) (int64, error)
StoragePoolVolumeSnapshotCreate creates a new storage volume snapshot attached to a given storage pool.
func (*Cluster) StoragePoolVolumeSnapshotUpdateByProject ¶
func (c *Cluster) StoragePoolVolumeSnapshotUpdateByProject(project, volumeName string, volumeType int, poolID int64, volumeDescription string, volumeConfig map[string]string, expiryDate time.Time) error
StoragePoolVolumeSnapshotUpdateByProject updates the storage volume snapshot attached to a given storage pool.
func (*Cluster) StoragePoolVolumeSnapshotsGetType ¶
func (c *Cluster) StoragePoolVolumeSnapshotsGetType(projectName string, volumeName string, volumeType int, poolID int64) ([]StorageVolumeArgs, error)
StoragePoolVolumeSnapshotsGetType get all snapshots of a storage volume attached to a given storage pool of a given volume type, on the given node. Returns snapshots slice ordered by when they were created, oldest first.
func (*Cluster) StoragePoolVolumeUpdateByProject ¶
func (c *Cluster) StoragePoolVolumeUpdateByProject(project, volumeName string, volumeType int, poolID int64, volumeDescription string, volumeConfig map[string]string) error
StoragePoolVolumeUpdateByProject updates the storage volume attached to a given storage pool.
func (*Cluster) StoragePoolVolumesGet ¶
func (c *Cluster) StoragePoolVolumesGet(project string, poolID int64, volumeTypes []int) ([]*api.StorageVolume, error)
StoragePoolVolumesGet returns all storage volumes attached to a given storage pool on any node.
func (*Cluster) StoragePoolVolumesGetAllByType ¶
func (c *Cluster) StoragePoolVolumesGetAllByType(volumeType int) ([]StorageVolumeArgs, error)
StoragePoolVolumesGetAllByType return a list of volumes by type.
func (*Cluster) StoragePoolVolumesGetNames ¶
StoragePoolVolumesGetNames gets the names of all storage volumes attached to a given storage pool.
func (*Cluster) StoragePools ¶
StoragePools returns the names of all storage pools.
func (*Cluster) StoragePoolsGetDrivers ¶
StoragePoolsGetDrivers returns the names of all storage volumes attached to a given storage pool.
func (*Cluster) StoragePoolsNotPending ¶
StoragePoolsNotPending returns the names of all storage pools that are not pending.
func (*Cluster) StorageVolumeCleanupImages ¶
StorageVolumeCleanupImages removes the volumes with the given fingerprints.
func (*Cluster) StorageVolumeDescriptionGet ¶
StorageVolumeDescriptionGet gets the description of a storage volume.
func (*Cluster) StorageVolumeIsAvailable ¶
StorageVolumeIsAvailable checks that if a custom volume available for being attached.
Always return true for non-Ceph volumes.
For Ceph volumes, return true if the volume is either not attached to any other container, or attached to containers on this node.
func (*Cluster) StorageVolumeMoveToLVMThinPoolNameKey ¶
StorageVolumeMoveToLVMThinPoolNameKey upgrades the config keys of LVM volumes.
func (*Cluster) StorageVolumeNextSnapshot ¶
StorageVolumeNextSnapshot returns the index of the next snapshot of the storage volume with the given name should have.
Note, the code below doesn't deal with snapshots of snapshots. To do that, we'll need to weed out based on # slashes in names
func (*Cluster) StorageVolumeSnapshotExpiryGet ¶
StorageVolumeSnapshotExpiryGet gets the expiry date of a storage volume snapshot.
func (*Cluster) StorageVolumeSnapshotsGetExpired ¶
func (c *Cluster) StorageVolumeSnapshotsGetExpired() ([]StorageVolumeArgs, error)
StorageVolumeSnapshotsGetExpired returns a list of expired volume snapshots.
func (*Cluster) Transaction ¶
Transaction creates a new ClusterTx object and transactionally executes the cluster database interactions invoked by the given function. If the function returns no error, all database changes are committed to the cluster database database, otherwise they are rolled back.
If EnterExclusive has been called before, calling Transaction will block until ExitExclusive has been called as well to release the lock.
type ClusterRole ¶
type ClusterRole string
ClusterRole represents the role of a member in a cluster.
type ClusterTx ¶
type ClusterTx struct {
// contains filtered or unexported fields
}
ClusterTx models a single interaction with a LXD cluster database.
It wraps low-level sql.Tx objects and offers a high-level API to fetch and update data.
func NewTestClusterTx ¶
NewTestClusterTx returns a fresh ClusterTx object, along with a function that can be called to cleanup state when done with it.
func (*ClusterTx) ContainerConfigInsert ¶
ContainerConfigInsert inserts a new config for the container with the given ID.
func (*ClusterTx) ContainerConfigUpdate ¶
ContainerConfigUpdate inserts/updates/deletes the provided keys
func (*ClusterTx) ContainerGetSnapshotsFull ¶
ContainerGetSnapshotsFull returns all container objects for snapshots of a given container
func (*ClusterTx) ContainerLastUsedUpdate ¶
ContainerLastUsedUpdate updates the last_use_date field of the container with the given ID.
func (*ClusterTx) ContainerNodeAddress ¶
func (c *ClusterTx) ContainerNodeAddress(project string, name string, instanceType instancetype.Type) (string, error)
ContainerNodeAddress returns the address of the node hosting the container with the given name in the given project.
It returns the empty string if the container is hosted on this node.
func (*ClusterTx) ContainerNodeMove ¶
ContainerNodeMove changes the node associated with a container.
It's meant to be used when moving a non-running container backed by ceph from one cluster node to another.
func (*ClusterTx) ContainerNodeProjectList ¶
func (c *ClusterTx) ContainerNodeProjectList(project string, instanceType instancetype.Type) ([]Instance, error)
ContainerNodeProjectList returns all container objects on the local node within the given project.
func (*ClusterTx) ContainerSetState ¶
ContainerSetState sets the the power state of the container with the given ID.
func (*ClusterTx) ContainersByNodeName ¶
func (c *ClusterTx) ContainersByNodeName(project string, instanceType instancetype.Type) (map[string]string, error)
ContainersByNodeName returns a map associating each container to the name of its node.
func (*ClusterTx) ContainersListByNodeAddress ¶
func (c *ClusterTx) ContainersListByNodeAddress(project string, instanceType instancetype.Type) (map[string][]string, error)
ContainersListByNodeAddress returns the names of all containers grouped by cluster node address.
The node address of containers running on the local node is set to the empty string, to distinguish it from remote nodes.
Containers whose node is down are addeded to the special address "0.0.0.0".
func (*ClusterTx) InstanceConfigRef ¶
func (c *ClusterTx) InstanceConfigRef(filter InstanceFilter) (map[string]map[string]map[string]string, error)
InstanceConfigRef returns entities used by instances.
func (*ClusterTx) InstanceCreate ¶
InstanceCreate adds a new instance to the database.
func (*ClusterTx) InstanceDelete ¶
InstanceDelete deletes the instance matching the given key parameters.
func (*ClusterTx) InstanceDevicesRef ¶
func (c *ClusterTx) InstanceDevicesRef(filter InstanceFilter) (map[string]map[string]map[string]map[string]string, error)
InstanceDevicesRef returns entities used by instances.
func (*ClusterTx) InstanceExists ¶
InstanceExists checks if a instance with the given key exists.
func (*ClusterTx) InstanceGet ¶
InstanceGet returns the instance with the given key.
func (*ClusterTx) InstanceID ¶
InstanceID return the ID of the instance with the given key.
func (*ClusterTx) InstanceList ¶
func (c *ClusterTx) InstanceList(filter InstanceFilter) ([]Instance, error)
InstanceList returns all available instances.
func (*ClusterTx) InstanceNames ¶
InstanceNames returns the names of all containers the given project.
func (*ClusterTx) InstancePool ¶
InstancePool returns the storage pool of a given instance.
func (*ClusterTx) InstanceProfilesRef ¶
func (c *ClusterTx) InstanceProfilesRef(filter InstanceFilter) (map[string]map[string][]string, error)
InstanceProfilesRef returns entities used by instances.
func (*ClusterTx) InstanceRename ¶
InstanceRename renames the instance matching the given key parameters.
func (*ClusterTx) InstanceSnapshotConfigRef ¶
func (c *ClusterTx) InstanceSnapshotConfigRef(filter InstanceSnapshotFilter) (map[string]map[string]map[string]map[string]string, error)
InstanceSnapshotConfigRef returns entities used by instance_snapshots.
func (*ClusterTx) InstanceSnapshotConfigUpdate ¶
InstanceSnapshotConfigUpdate inserts/updates/deletes the provided config keys.
func (*ClusterTx) InstanceSnapshotCreate ¶
func (c *ClusterTx) InstanceSnapshotCreate(object InstanceSnapshot) (int64, error)
InstanceSnapshotCreate adds a new instance_snapshot to the database.
func (*ClusterTx) InstanceSnapshotDelete ¶
InstanceSnapshotDelete deletes the instance_snapshot matching the given key parameters.
func (*ClusterTx) InstanceSnapshotDevicesRef ¶
func (c *ClusterTx) InstanceSnapshotDevicesRef(filter InstanceSnapshotFilter) (map[string]map[string]map[string]map[string]map[string]string, error)
InstanceSnapshotDevicesRef returns entities used by instance_snapshots.
func (*ClusterTx) InstanceSnapshotExists ¶
func (c *ClusterTx) InstanceSnapshotExists(project string, instance string, name string) (bool, error)
InstanceSnapshotExists checks if a instance_snapshot with the given key exists.
func (*ClusterTx) InstanceSnapshotGet ¶
func (c *ClusterTx) InstanceSnapshotGet(project string, instance string, name string) (*InstanceSnapshot, error)
InstanceSnapshotGet returns the instance_snapshot with the given key.
func (*ClusterTx) InstanceSnapshotID ¶
InstanceSnapshotID return the ID of the instance_snapshot with the given key.
func (*ClusterTx) InstanceSnapshotList ¶
func (c *ClusterTx) InstanceSnapshotList(filter InstanceSnapshotFilter) ([]InstanceSnapshot, error)
InstanceSnapshotList returns all available instance_snapshots.
func (*ClusterTx) InstanceSnapshotRename ¶
func (c *ClusterTx) InstanceSnapshotRename(project string, instance string, name string, to string) error
InstanceSnapshotRename renames the instance_snapshot matching the given key parameters.
func (*ClusterTx) NetworkConfigAdd ¶
NetworkConfigAdd adds a new entry in the networks_config table
func (*ClusterTx) NetworkCreatePending ¶
NetworkCreatePending creates a new pending network on the node with the given name.
func (*ClusterTx) NetworkCreated ¶
NetworkCreated sets the state of the given network to "Created".
func (*ClusterTx) NetworkErrored ¶
NetworkErrored sets the state of the given network to "Errored".
func (*ClusterTx) NetworkIDsNotPending ¶
NetworkIDsNotPending returns a map associating each network name to its ID.
Pending networks are skipped.
func (*ClusterTx) NetworkNodeConfigs ¶
NetworkNodeConfigs returns the node-specific configuration of all nodes grouped by node name, for the given networkID.
If the network is not defined on all nodes, an error is returned.
func (*ClusterTx) NetworkNodeJoin ¶
NetworkNodeJoin adds a new entry in the networks_nodes table.
It should only be used when a new node joins the cluster, when it's safe to assume that the relevant network has already been created on the joining node, and we just need to track it.
func (*ClusterTx) NetworksNodeConfig ¶
NetworksNodeConfig returns a map associating each network name to its node-specific config values (i.e. the ones where node_id is not NULL).
func (*ClusterTx) NodeAdd ¶
NodeAdd adds a node to the current list of LXD nodes that are part of the cluster. The node's architecture will be the architecture of the machine the method is being run on. It returns the ID of the newly inserted row.
func (*ClusterTx) NodeAddRole ¶
func (c *ClusterTx) NodeAddRole(id int64, role ClusterRole) error
NodeAddRole adds a role to the node.
func (*ClusterTx) NodeAddWithArch ¶
NodeAddWithArch is the same as NodeAdd, but lets setting the node architecture explicitly.
func (*ClusterTx) NodeAddress ¶
NodeAddress returns the address of the node this method is invoked on.
func (*ClusterTx) NodeByAddress ¶
NodeByAddress returns the node with the given network address.
func (*ClusterTx) NodeByName ¶
NodeByName returns the node with the given name.
func (*ClusterTx) NodeHeartbeat ¶
NodeHeartbeat updates the heartbeat column of the node with the given address.
func (*ClusterTx) NodeID ¶
NodeID sets the the node NodeID associated with this cluster transaction.
func (*ClusterTx) NodeIsEmpty ¶
NodeIsEmpty returns an empty string if the node with the given ID has no containers or images associated with it. Otherwise, it returns a message say what's left.
func (*ClusterTx) NodeIsOutdated ¶
NodeIsOutdated returns true if there's some cluster node having an API or schema version greater than the node this method is invoked on.
func (*ClusterTx) NodeOfflineThreshold ¶
NodeOfflineThreshold returns the amount of time that needs to elapse after which a series of unsuccessful heartbeat will make the node be considered offline.
func (*ClusterTx) NodePending ¶
NodePending toggles the pending flag for the node. A node is pending when it's been accepted in the cluster, but has not yet actually joined it.
func (*ClusterTx) NodePendingByAddress ¶
NodePendingByAddress returns the pending node with the given network address.
func (*ClusterTx) NodeRemove ¶
NodeRemove removes the node with the given id.
func (*ClusterTx) NodeRemoveRole ¶
func (c *ClusterTx) NodeRemoveRole(id int64, role ClusterRole) error
NodeRemoveRole removes a role from the node.
func (*ClusterTx) NodeRename ¶
NodeRename changes the name of an existing node.
Return an error if a node with the same name already exists.
func (*ClusterTx) NodeUpdate ¶
NodeUpdate updates the name an address of a node.
func (*ClusterTx) NodeUpdateRoles ¶
func (c *ClusterTx) NodeUpdateRoles(id int64, roles []ClusterRole) error
NodeUpdateRoles changes the list of roles on a member.
func (*ClusterTx) NodeUpdateVersion ¶
NodeUpdateVersion updates the schema and API version of the node with the given id. This is used only in tests.
func (*ClusterTx) NodeWithLeastContainers ¶
NodeWithLeastContainers returns the name of the non-offline node with with the least number of containers (either already created or being created with an operation). If archs is not empty, then return only nodes with an architecture in that list.
func (*ClusterTx) Nodes ¶
Nodes returns all LXD nodes part of the cluster.
If this LXD instance is not clustered, a list with a single node whose address is 0.0.0.0 is returned.
func (*ClusterTx) NodesCount ¶
NodesCount returns the number of nodes in the LXD cluster.
Since there's always at least one node row, even when not-clustered, the return value is greater than zero
func (*ClusterTx) OperationAdd ¶
func (c *ClusterTx) OperationAdd(project, uuid string, typ OperationType) (int64, error)
OperationAdd adds a new operations to the table.
func (*ClusterTx) OperationByUUID ¶
OperationByUUID returns the operation with the given UUID.
func (*ClusterTx) OperationFlush ¶
OperationFlush removes all operations for the given node.
func (*ClusterTx) OperationNodes ¶
OperationNodes returns a list of nodes that have running operations
func (*ClusterTx) OperationRemove ¶
OperationRemove removes the operation with the given UUID.
func (*ClusterTx) Operations ¶
Operations returns all operations associated with this node.
func (*ClusterTx) OperationsUUIDs ¶
OperationsUUIDs returns the UUIDs of all operations associated with this node.
func (*ClusterTx) ProfileConfigRef ¶
func (c *ClusterTx) ProfileConfigRef(filter ProfileFilter) (map[string]map[string]map[string]string, error)
ProfileConfigRef returns entities used by profiles.
func (*ClusterTx) ProfileCreate ¶
ProfileCreate adds a new profile to the database.
func (*ClusterTx) ProfileDelete ¶
ProfileDelete deletes the profile matching the given key parameters.
func (*ClusterTx) ProfileDevicesRef ¶
func (c *ClusterTx) ProfileDevicesRef(filter ProfileFilter) (map[string]map[string]map[string]map[string]string, error)
ProfileDevicesRef returns entities used by profiles.
func (*ClusterTx) ProfileExists ¶
ProfileExists checks if a profile with the given key exists.
func (*ClusterTx) ProfileGet ¶
ProfileGet returns the profile with the given key.
func (*ClusterTx) ProfileList ¶
func (c *ClusterTx) ProfileList(filter ProfileFilter) ([]Profile, error)
ProfileList returns all available profiles.
func (*ClusterTx) ProfileRename ¶
ProfileRename renames the profile matching the given key parameters.
func (*ClusterTx) ProfileURIs ¶
func (c *ClusterTx) ProfileURIs(filter ProfileFilter) ([]string, error)
ProfileURIs returns all available profile URIs.
func (*ClusterTx) ProfileUsedByRef ¶
ProfileUsedByRef returns entities used by profiles.
func (*ClusterTx) ProjectConfigRef ¶
ProjectConfigRef returns entities used by projects.
func (*ClusterTx) ProjectCreate ¶
func (c *ClusterTx) ProjectCreate(object api.ProjectsPost) (int64, error)
ProjectCreate adds a new project to the database.
func (*ClusterTx) ProjectDelete ¶
ProjectDelete deletes the project matching the given key parameters.
func (*ClusterTx) ProjectExists ¶
ProjectExists checks if a project with the given key exists.
func (*ClusterTx) ProjectGet ¶
ProjectGet returns the project with the given key.
func (*ClusterTx) ProjectHasImages ¶
ProjectHasImages is a helper to check if a project has the images feature enabled.
func (*ClusterTx) ProjectHasProfiles ¶
ProjectHasProfiles is a helper to check if a project has the profiles feature enabled.
func (*ClusterTx) ProjectLaunchWithoutImages ¶
ProjectLaunchWithoutImages updates the images_profiles table when a Project is created with features.images=false.
func (*ClusterTx) ProjectList ¶
func (c *ClusterTx) ProjectList(filter ProjectFilter) ([]api.Project, error)
ProjectList returns all available projects.
func (*ClusterTx) ProjectMap ¶
ProjectMap returns the names and ids of all available projects.
func (*ClusterTx) ProjectNames ¶
ProjectNames returns the names of all available projects.
func (*ClusterTx) ProjectRename ¶
ProjectRename renames the project matching the given key parameters.
func (*ClusterTx) ProjectURIs ¶
func (c *ClusterTx) ProjectURIs(filter ProjectFilter) ([]string, error)
ProjectURIs returns all available project URIs.
func (*ClusterTx) ProjectUpdate ¶
func (c *ClusterTx) ProjectUpdate(name string, object api.ProjectPut) error
ProjectUpdate updates the project matching the given key parameters.
func (*ClusterTx) ProjectUsedByRef ¶
func (c *ClusterTx) ProjectUsedByRef(filter ProjectFilter) (map[string][]string, error)
ProjectUsedByRef returns entities used by projects.
func (*ClusterTx) StoragePoolConfigAdd ¶
StoragePoolConfigAdd adds a new entry in the storage_pools_config table
func (*ClusterTx) StoragePoolCreatePending ¶
func (c *ClusterTx) StoragePoolCreatePending(node, name, driver string, conf map[string]string) error
StoragePoolCreatePending creates a new pending storage pool on the node with the given name.
func (*ClusterTx) StoragePoolCreated ¶
StoragePoolCreated sets the state of the given pool to "Created".
func (*ClusterTx) StoragePoolDriver ¶
StoragePoolDriver returns the driver of the pool with the given ID.
func (*ClusterTx) StoragePoolErrored ¶
StoragePoolErrored sets the state of the given pool to "Errored".
func (*ClusterTx) StoragePoolID ¶
StoragePoolID returns the ID of the pool with the given name.
func (*ClusterTx) StoragePoolIDsNotPending ¶
StoragePoolIDsNotPending returns a map associating each storage pool name to its ID.
Pending storage pools are skipped.
func (*ClusterTx) StoragePoolNodeConfigs ¶
StoragePoolNodeConfigs returns the node-specific configuration of all nodes grouped by node name, for the given poolID.
If the storage pool is not defined on all nodes, an error is returned.
func (*ClusterTx) StoragePoolNodeJoin ¶
StoragePoolNodeJoin adds a new entry in the storage_pools_nodes table.
It should only be used when a new node joins the cluster, when it's safe to assume that the relevant pool has already been created on the joining node, and we just need to track it.
func (*ClusterTx) StoragePoolNodeJoinCeph ¶
StoragePoolNodeJoinCeph updates internal state to reflect that nodeID is joining a cluster where poolID is a ceph pool.
func (*ClusterTx) StoragePoolsNodeConfig ¶
StoragePoolsNodeConfig returns a map associating each storage pool name to its node-specific config values (i.e. the ones where node_id is not NULL).
func (*ClusterTx) StorageVolumeNodeAddresses ¶
func (c *ClusterTx) StorageVolumeNodeAddresses(poolID int64, project, name string, typ int) ([]string, error)
StorageVolumeNodeAddresses returns the addresses of all nodes on which the volume with the given name if defined.
The volume name can be either a regular name or a volume snapshot name.
The empty string is used in place of the address of the current node.
type Dump ¶
type Dump struct { // Map table names to the names or their columns. Schema map[string][]string // Map a table name to all the rows it contains. Each row is a slice // of interfaces. Data map[string][][]interface{} }
Dump is a dump of all the user data in the local db prior the migration to the cluster db.
func LoadPreClusteringData ¶
LoadPreClusteringData loads all the data that before the introduction of LXD clustering used to live in the node-level database.
This is used for performing a one-off data migration when a LXD instance is upgraded from a version without clustering to a version that supports clustering, since in those version all data lives in the cluster database (regardless of whether clustering is actually on or off).
type ExpiredImage ¶
ExpiredImage used to store expired image info.
type Instance ¶
type Instance struct { ID int Project string `db:"primary=yes&join=projects.name"` Name string `db:"primary=yes"` Node string `db:"join=nodes.name"` Type instancetype.Type Snapshot bool `db:"ignore"` Architecture int Ephemeral bool CreationDate time.Time Stateful bool LastUseDate time.Time Description string `db:"coalesce=''"` Config map[string]string Devices map[string]map[string]string Profiles []string ExpiryDate time.Time }
Instance is a value object holding db-related details about a container.
func InstanceSnapshotToInstance ¶
func InstanceSnapshotToInstance(instance *Instance, snapshot *InstanceSnapshot) Instance
InstanceSnapshotToInstance is a temporary convenience function to merge together an Instance struct and a SnapshotInstance struct into into a the legacy Instance struct for a snapshot.
type InstanceArgs ¶
type InstanceArgs struct { // Don't set manually ID int Node string Type instancetype.Type Snapshot bool // Creation only Project string BaseImage string CreationDate time.Time Architecture int Config map[string]string Description string Devices deviceConfig.Devices Ephemeral bool LastUsedDate time.Time Name string Profiles []string Stateful bool ExpiryDate time.Time }
InstanceArgs is a value object holding all db-related details about an instance.
func InstanceToArgs ¶
func InstanceToArgs(inst *Instance) InstanceArgs
InstanceToArgs is a convenience to convert an Instance db struct into the legacy InstanceArgs.
type InstanceBackupArgs ¶
type InstanceBackupArgs struct { // Don't set manually ID int InstanceID int Name string CreationDate time.Time ExpiryDate time.Time InstanceOnly bool OptimizedStorage bool CompressionAlgorithm string }
InstanceBackupArgs is a value object holding all db-related details about a backup.
type InstanceFilter ¶
type InstanceFilter struct { Project string Name string Node string Type instancetype.Type }
InstanceFilter can be used to filter results yielded by InstanceList.
type InstanceSnapshot ¶
type InstanceSnapshot struct { ID int Project string `db:"primary=yes&join=projects.name&via=instance"` Instance string `db:"primary=yes&join=instances.name"` Name string `db:"primary=yes"` CreationDate time.Time Stateful bool Description string `db:"coalesce=''"` Config map[string]string Devices map[string]map[string]string ExpiryDate time.Time }
InstanceSnapshot is a value object holding db-related details about a snapshot.
type InstanceSnapshotFilter ¶
InstanceSnapshotFilter can be used to filter results yielded by InstanceSnapshotList.
type LegacyPatch ¶
LegacyPatch is a "database" update that performs non-database work. They are needed for historical reasons, since there was a time were db updates could do non-db work and depend on functionality external to the db package. See UpdatesApplyAll below.
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node mediates access to LXD's data stored in the node-local SQLite database.
func ForLegacyPatches ¶
ForLegacyPatches is a aid for the hack in initializeDbObject, which sets the db-related Deamon attributes upfront, to be backward compatible with the legacy patches that need to interact with the database.
func NewTestNode ¶
NewTestNode creates a new Node for testing purposes, along with a function that can be used to clean it up when done.
func (*Node) DB ¶
DB returns the low level database handle to the node-local SQLite database.
FIXME: this is used for compatibility with some legacy code, and should be
dropped once there are no call sites left.
func (*Node) PatchesMarkApplied ¶
PatchesMarkApplied marks the patch with the given name as applied on this node.
func (*Node) Transaction ¶
Transaction creates a new NodeTx object and transactionally executes the node-level database interactions invoked by the given function. If the function returns no error, all database changes are committed to the node-level database, otherwise they are rolled back.
type NodeInfo ¶
type NodeInfo struct { ID int64 // Stable node identifier Name string // User-assigned name of the node Address string // Network address of the node Description string // Node description (optional) Schema int // Schema version of the LXD code running the node APIExtensions int // Number of API extensions of the LXD code running on the node Heartbeat time.Time // Timestamp of the last heartbeat Roles []string // List of cluster roles Architecture int // Node architecture }
NodeInfo holds information about a single LXD instance in a cluster.
type NodeTx ¶
type NodeTx struct {
// contains filtered or unexported fields
}
NodeTx models a single interaction with a LXD node-local database.
It wraps low-level sql.Tx objects and offers a high-level API to fetch and update data.
func NewTestNodeTx ¶
NewTestNodeTx returns a fresh NodeTx object, along with a function that can be called to cleanup state when done with it.
func (*NodeTx) RaftNodeAdd ¶
RaftNodeAdd adds a node to the current list of LXD nodes that are part of the dqlite Raft cluster. It returns the ID of the newly inserted row.
func (*NodeTx) RaftNodeAddress ¶
RaftNodeAddress returns the address of the LXD raft node with the given ID, if any matching row exists.
func (*NodeTx) RaftNodeAddresses ¶
RaftNodeAddresses returns the addresses of all LXD nodes that are members of the dqlite Raft cluster (possibly including the local node). If this LXD instance is not running in clustered mode, an empty list is returned.
func (*NodeTx) RaftNodeDelete ¶
RaftNodeDelete removes a node from the current list of LXD nodes that are part of the dqlite Raft cluster.
func (*NodeTx) RaftNodeFirst ¶
RaftNodeFirst adds a the first node of the cluster. It ensures that the database ID is 1, to match the server ID of first raft log entry.
This method is supposed to be called when there are no rows in raft_nodes, and it will replace whatever existing row has ID 1.
func (*NodeTx) RaftNodes ¶
RaftNodes returns information about all LXD nodes that are members of the dqlite Raft cluster (possibly including the local node). If this LXD instance is not running in clustered mode, an empty list is returned.
func (*NodeTx) RaftNodesReplace ¶
RaftNodesReplace replaces the current list of raft nodes.
type Operation ¶
type Operation struct { ID int64 // Stable database identifier UUID string // User-visible identifier NodeAddress string // Address of the node the operation is running on Type OperationType // Type of the operation }
Operation holds information about a single LXD operation running on a node in the cluster.
type OperationType ¶
type OperationType int64
OperationType is a numeric code indentifying the type of an Operation.
const ( OperationUnknown OperationType = iota OperationClusterBootstrap OperationClusterJoin OperationBackupCreate OperationBackupRename OperationBackupRestore OperationBackupRemove OperationConsoleShow OperationContainerCreate OperationContainerUpdate OperationContainerRename OperationContainerMigrate OperationContainerLiveMigrate OperationContainerFreeze OperationContainerUnfreeze OperationContainerDelete OperationContainerStart OperationContainerStop OperationContainerRestart OperationCommandExec OperationSnapshotCreate OperationSnapshotRename OperationSnapshotRestore OperationSnapshotTransfer OperationSnapshotUpdate OperationSnapshotDelete OperationImageDownload OperationImageDelete OperationImageToken OperationImageRefresh OperationVolumeCopy OperationVolumeCreate OperationVolumeMigrate OperationVolumeMove OperationVolumeSnapshotCreate OperationVolumeSnapshotDelete OperationVolumeSnapshotUpdate OperationProjectRename OperationImagesExpire OperationImagesPruneLeftover OperationImagesUpdate OperationImagesSynchronize OperationLogsExpire OperationInstanceTypesUpdate OperationBackupsExpire OperationSnapshotsExpire OperationCustomVolumeSnapshotsExpire )
Possible values for OperationType
WARNING: The type codes are stored in the database, so this list of
definitions should be normally append-only. Any other change requires a database update.
func (OperationType) Description ¶
func (t OperationType) Description() string
Description return a human-readable description of the operation type.
func (OperationType) Permission ¶
func (t OperationType) Permission() string
Permission returns the needed RBAC permission to cancel the oepration
type Profile ¶
type Profile struct { ID int Project string `db:"primary=yes&join=projects.name"` Name string `db:"primary=yes"` Description string `db:"coalesce=''"` Config map[string]string Devices map[string]map[string]string UsedBy []string }
Profile is a value object holding db-related details about a profile.
type ProfileFilter ¶
ProfileFilter can be used to filter results yielded by ProfileList.
type ProjectFilter ¶
type ProjectFilter struct {
Name string // If non-empty, return only the project with this name.
}
ProjectFilter can be used to filter results yielded by ProjectList.
type RaftNode ¶
RaftNode holds information about a single node in the dqlite raft cluster.
This is just a convenience alias for the equivalent data structure in the dqlite client package.
type StorageVolumeArgs ¶
type StorageVolumeArgs struct { ID int64 Name string // At least one of Type or TypeName must be set. Type int TypeName string // At least one of PoolID or PoolName must be set. PoolID int64 PoolName string Snapshot bool Config map[string]string Description string CreationDate time.Time ExpiryDate time.Time // At least on of ProjectID or ProjectName must be set. ProjectID int64 ProjectName string }
StorageVolumeArgs is a value object holding all db-related details about a storage volume.
Source Files ¶
- certificates.go
- config.go
- containers.go
- db.go
- devices.go
- errors.go
- images.go
- instances.mapper.go
- legacy.go
- migration.go
- networks.go
- node.go
- operations.go
- operations_types.go
- patches.go
- profiles.go
- profiles.mapper.go
- projects.go
- projects.mapper.go
- raft.go
- schema.go
- snapshots.go
- snapshots.mapper.go
- storage_pools.go
- storage_volume_snapshots.go
- storage_volumes.go
- testing.go
- transaction.go
Directories ¶
Path | Synopsis |
---|---|
Package query implements helpers around database/sql to execute various kinds of very common SQL queries.
|
Package query implements helpers around database/sql to execute various kinds of very common SQL queries. |
Package schema offers utilities to create and maintain a database schema.
|
Package schema offers utilities to create and maintain a database schema. |