Documentation ¶
Index ¶
- func APIClient(c *lc.HighLevelClient) func(*Linstor) error
- func LogFmt(fmt logrus.Formatter) func(*Linstor) error
- func LogLevel(s string) func(*Linstor) error
- func LogOut(out io.Writer) func(*Linstor) error
- type DeleteInProgressError
- type Linstor
- func (s *Linstor) AccessibleTopologies(ctx context.Context, vol *volume.Info) ([]*csi.Topology, error)
- func (s *Linstor) AllocationSizeKiB(requiredBytes, limitBytes int64) (int64, error)
- func (s *Linstor) Attach(ctx context.Context, vol *volume.Info, node string) error
- func (s *Linstor) CapacityBytes(ctx context.Context, parameters, segments map[string]string) (int64, error)
- func (s *Linstor) CompatibleSnapshotId(name string) string
- func (s *Linstor) ControllerExpand(ctx context.Context, vol *volume.Info) error
- func (s *Linstor) Create(ctx context.Context, vol *volume.Info, req *csi.CreateVolumeRequest) error
- func (s *Linstor) Delete(ctx context.Context, vol *volume.Info) error
- func (s *Linstor) Detach(ctx context.Context, vol *volume.Info, node string) error
- func (s *Linstor) FindByID(ctx context.Context, id string) (*volume.Info, error)
- func (s *Linstor) FindByName(ctx context.Context, name string) (*volume.Info, error)
- func (s *Linstor) FindSnapByID(ctx context.Context, id string) (*csi.Snapshot, bool, error)
- func (s *Linstor) FindSnapsBySource(ctx context.Context, sourceVol *volume.Info, start, limit int) ([]*csi.Snapshot, error)
- func (s *Linstor) GetAssignmentOnNode(ctx context.Context, vol *volume.Info, node string) (*volume.Assignment, error)
- func (s *Linstor) GetNodeTopologies(ctx context.Context, nodename string) (*csi.Topology, error)
- func (s *Linstor) GetVolumeStats(path string) (volume.VolumeStats, error)
- func (s *Linstor) IsNotMountPoint(target string) (bool, error)
- func (s *Linstor) ListAll(ctx context.Context) ([]*volume.Info, error)
- func (s *Linstor) ListSnaps(ctx context.Context, start, limit int) ([]*csi.Snapshot, error)
- func (s *Linstor) Mount(ctx context.Context, vol *volume.Info, source, target, fsType string, ...) error
- func (s *Linstor) NodeAvailable(ctx context.Context, node string) error
- func (s *Linstor) NodeExpand(source, target string) error
- func (s *Linstor) SnapCreate(ctx context.Context, id string, sourceVol *volume.Info) (*csi.Snapshot, error)
- func (s *Linstor) SnapDelete(ctx context.Context, snap *csi.Snapshot) error
- func (s *Linstor) Unmount(target string) error
- func (s *Linstor) VolFromSnap(ctx context.Context, snap *csi.Snapshot, vol *volume.Info) error
- type MockStorage
- func (s *MockStorage) AccessibleTopologies(ctx context.Context, vol *volume.Info) ([]*csi.Topology, error)
- func (s *MockStorage) AllocationSizeKiB(requiredBytes, limitBytes int64) (int64, error)
- func (s *MockStorage) Attach(ctx context.Context, vol *volume.Info, node string) error
- func (s *MockStorage) CapacityBytes(ctx context.Context, params, segments map[string]string) (int64, error)
- func (s *MockStorage) CompatibleSnapshotId(name string) string
- func (s *MockStorage) ControllerExpand(ctx context.Context, vol *volume.Info) error
- func (s *MockStorage) Create(ctx context.Context, vol *volume.Info, req *csi.CreateVolumeRequest) error
- func (s *MockStorage) Delete(ctx context.Context, vol *volume.Info) error
- func (s *MockStorage) Detach(ctx context.Context, vol *volume.Info, node string) error
- func (s *MockStorage) FindByID(ctx context.Context, id string) (*volume.Info, error)
- func (s *MockStorage) FindByName(ctx context.Context, name string) (*volume.Info, error)
- func (s *MockStorage) FindSnapByID(ctx context.Context, id string) (*csi.Snapshot, bool, error)
- func (s *MockStorage) FindSnapsBySource(ctx context.Context, sourceVol *volume.Info, start, limit int) ([]*csi.Snapshot, error)
- func (s *MockStorage) GetAssignmentOnNode(ctx context.Context, vol *volume.Info, node string) (*volume.Assignment, error)
- func (s *MockStorage) GetNodeTopologies(_ context.Context, node string) (*csi.Topology, error)
- func (s *MockStorage) GetVolumeStats(path string) (volume.VolumeStats, error)
- func (s *MockStorage) IsNotMountPoint(target string) (bool, error)
- func (s *MockStorage) ListAll(ctx context.Context) ([]*volume.Info, error)
- func (s *MockStorage) ListSnaps(ctx context.Context, start, limit int) ([]*csi.Snapshot, error)
- func (s *MockStorage) Mount(ctx context.Context, vol *volume.Info, source, target, fsType string, ...) error
- func (s *MockStorage) NodeAvailable(ctx context.Context, node string) error
- func (s *MockStorage) NodeExpand(source, target string) error
- func (s *MockStorage) SnapCreate(ctx context.Context, id string, sourceVol *volume.Info) (*csi.Snapshot, error)
- func (s *MockStorage) SnapDelete(ctx context.Context, snap *csi.Snapshot) error
- func (s *MockStorage) Unmount(target string) error
- func (s *MockStorage) VolFromSnap(ctx context.Context, snap *csi.Snapshot, vol *volume.Info) error
- func (s *MockStorage) VolFromVol(ctx context.Context, sourceVol, vol *volume.Info) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIClient ¶ added in v0.8.0
func APIClient(c *lc.HighLevelClient) func(*Linstor) error
APIClient the configured LINSTOR API client that will be used to communicate with the LINSTOR cluster.
func LogFmt ¶ added in v0.8.0
LogFmt sets the format of the log outpout via the provided logrus.Formatter.
Types ¶
type DeleteInProgressError ¶ added in v0.13.1
func (*DeleteInProgressError) Error ¶ added in v0.13.1
func (d *DeleteInProgressError) Error() string
type Linstor ¶
type Linstor struct {
// contains filtered or unexported fields
}
Linstor is a high-level client for use with CSI.
func NewLinstor ¶
NewLinstor returns a high-level linstor client for CSI applications to interact with By default, it will try to connect with localhost:3370.
func (*Linstor) AccessibleTopologies ¶ added in v0.8.0
func (s *Linstor) AccessibleTopologies(ctx context.Context, vol *volume.Info) ([]*csi.Topology, error)
AccessibleTopologies returns a list of pointers to csi.Topology from where the volume is reachable, based on the localStoragePolicy reported by the volume.
func (*Linstor) AllocationSizeKiB ¶ added in v0.3.0
AllocationSizeKiB returns LINSTOR's smallest possible number of KiB that can satisfy the requiredBytes.
func (*Linstor) CapacityBytes ¶ added in v0.8.0
func (s *Linstor) CapacityBytes(ctx context.Context, parameters, segments map[string]string) (int64, error)
CapacityBytes returns the amount of free space in the storage pool specified by the params and topology.
func (*Linstor) CompatibleSnapshotId ¶ added in v0.11.0
func (*Linstor) ControllerExpand ¶ added in v0.9.0
func (*Linstor) Create ¶
Create creates the resource definition, volume definition, and assigns the resulting resource to LINSTOR nodes.
func (*Linstor) Delete ¶
Delete removes a resource, all of its volumes from LINSTOR. Only removes the ResourceDefinition if no snapshots of the resource exist.
func (*Linstor) FindByID ¶ added in v0.10.2
FindByID retrives a volume.Info that has an id that matches the CSI volume id. Matches the LINSTOR resource name.
func (*Linstor) FindByName ¶ added in v0.10.2
FindByID retrives a volume.Info that has a name that matches the CSI volume Name, not nessesarily the LINSTOR resource name or UUID.
func (*Linstor) FindSnapByID ¶ added in v0.11.0
func (*Linstor) FindSnapsBySource ¶ added in v0.11.0
func (*Linstor) GetAssignmentOnNode ¶
func (s *Linstor) GetAssignmentOnNode(ctx context.Context, vol *volume.Info, node string) (*volume.Assignment, error)
GetAssignmentOnNode returns a pointer to a volume.Assignment for a given node.
func (*Linstor) GetNodeTopologies ¶ added in v0.10.0
func (*Linstor) GetVolumeStats ¶ added in v0.8.0
func (s *Linstor) GetVolumeStats(path string) (volume.VolumeStats, error)
GetVolumeStats determines filesystem usage.
func (*Linstor) IsNotMountPoint ¶ added in v0.8.0
IsNotMountPoint determines if a directory is a mountpoint.
Non-existent paths return (true, nil).
func (*Linstor) ListAll ¶
ListAll returns a sorted list of pointers to volume.Info. Only the LINSTOR volumes that can be serialized into a volume.Info are included.
func (*Linstor) ListSnaps ¶ added in v0.8.0
ListSnaps returns list of pointers to volume.SnapInfo based off of the serialized snapshot info stored in resource definitions.
func (*Linstor) Mount ¶
func (s *Linstor) Mount(ctx context.Context, vol *volume.Info, source, target, fsType string, readonly bool, options []string) error
Mount makes volumes consumable from the source to the target. Filesystems are formatted and block devices are bind mounted. Operates locally on the machines where it is called.
func (*Linstor) NodeAvailable ¶
NodeAvailable makes sure that LINSTOR considers that the node is in an ONLINE state.
func (*Linstor) NodeExpand ¶ added in v0.9.0
func (*Linstor) SnapCreate ¶ added in v0.8.0
func (s *Linstor) SnapCreate(ctx context.Context, id string, sourceVol *volume.Info) (*csi.Snapshot, error)
SnapCreate calls linstor to create a new snapshot on the volume indicated by the SourceVolumeId contained in the CSI Snapshot.
func (*Linstor) SnapDelete ¶ added in v0.8.0
SnapDelete calls LINSTOR to delete the snapshot based on the CSI Snapshot ID.
type MockStorage ¶
type MockStorage struct {
// contains filtered or unexported fields
}
func (*MockStorage) AccessibleTopologies ¶ added in v0.8.0
func (*MockStorage) AllocationSizeKiB ¶ added in v0.3.0
func (s *MockStorage) AllocationSizeKiB(requiredBytes, limitBytes int64) (int64, error)
func (*MockStorage) CapacityBytes ¶ added in v0.8.0
func (*MockStorage) CompatibleSnapshotId ¶ added in v0.11.0
func (s *MockStorage) CompatibleSnapshotId(name string) string
func (*MockStorage) ControllerExpand ¶ added in v0.9.0
func (*MockStorage) Create ¶
func (s *MockStorage) Create(ctx context.Context, vol *volume.Info, req *csi.CreateVolumeRequest) error
func (*MockStorage) FindByName ¶ added in v0.10.2
func (*MockStorage) FindSnapByID ¶ added in v0.11.0
func (*MockStorage) FindSnapsBySource ¶ added in v0.11.0
func (*MockStorage) GetAssignmentOnNode ¶
func (s *MockStorage) GetAssignmentOnNode(ctx context.Context, vol *volume.Info, node string) (*volume.Assignment, error)
func (*MockStorage) GetNodeTopologies ¶ added in v0.10.0
func (*MockStorage) GetVolumeStats ¶ added in v0.8.0
func (s *MockStorage) GetVolumeStats(path string) (volume.VolumeStats, error)
func (*MockStorage) IsNotMountPoint ¶ added in v0.8.0
func (s *MockStorage) IsNotMountPoint(target string) (bool, error)
func (*MockStorage) NodeAvailable ¶
func (s *MockStorage) NodeAvailable(ctx context.Context, node string) error
func (*MockStorage) NodeExpand ¶ added in v0.9.0
func (s *MockStorage) NodeExpand(source, target string) error
func (*MockStorage) SnapCreate ¶ added in v0.8.0
func (*MockStorage) SnapDelete ¶ added in v0.8.0
func (*MockStorage) Unmount ¶
func (s *MockStorage) Unmount(target string) error