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 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) CanonicalizeSnapshotName(ctx context.Context, suggestedName string) string
- func (s *Linstor) CapacityBytes(ctx context.Context, parameters map[string]string) (int64, error)
- 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) GetAssignmentOnNode(ctx context.Context, vol *volume.Info, node string) (*volume.Assignment, error)
- func (s *Linstor) GetByID(ctx context.Context, id string) (*volume.Info, error)
- func (s *Linstor) GetByName(ctx context.Context, name string) (*volume.Info, error)
- func (s *Linstor) GetSnapByID(ctx context.Context, id string) (*volume.SnapInfo, error)
- func (s *Linstor) GetSnapByName(ctx context.Context, name string) (*volume.SnapInfo, 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) ([]*volume.SnapInfo, error)
- func (s *Linstor) ListVolumes(ctx context.Context) ([]*volume.Info, error)
- func (s *Linstor) Mount(vol *volume.Info, source, target, fsType string, options []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, snap *volume.SnapInfo) (*volume.SnapInfo, error)
- func (s *Linstor) SnapDelete(ctx context.Context, snap *volume.SnapInfo) error
- func (s *Linstor) Unmount(target string) error
- func (s *Linstor) VolFromSnap(ctx context.Context, snap *volume.SnapInfo, vol *volume.Info) error
- func (s *Linstor) VolFromVol(ctx context.Context, sourceVol, 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) CanonicalizeSnapshotName(ctx context.Context, suggestedName string) string
- func (s *MockStorage) CapacityBytes(ctx context.Context, params map[string]string) (int64, error)
- 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) GetAssignmentOnNode(ctx context.Context, vol *volume.Info, node string) (*volume.Assignment, error)
- func (s *MockStorage) GetByID(ctx context.Context, id string) (*volume.Info, error)
- func (s *MockStorage) GetByName(ctx context.Context, name string) (*volume.Info, error)
- func (s *MockStorage) GetSnapByID(ctx context.Context, id string) (*volume.SnapInfo, error)
- func (s *MockStorage) GetSnapByName(ctx context.Context, name string) (*volume.SnapInfo, 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) ([]*volume.SnapInfo, error)
- func (s *MockStorage) Mount(vol *volume.Info, source, target, fsType string, options []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, snap *volume.SnapInfo) (*volume.SnapInfo, error)
- func (s *MockStorage) SnapDelete(ctx context.Context, snap *volume.SnapInfo) error
- func (s *MockStorage) Unmount(target string) error
- func (s *MockStorage) VolFromSnap(ctx context.Context, snap *volume.SnapInfo, 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 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) CanonicalizeSnapshotName ¶ added in v0.8.0
CanonicalizeSnapshotName makes sure that the snapshot name meets LINSTOR's naming conventions.
func (*Linstor) CapacityBytes ¶ added in v0.8.0
CapacityBytes returns the amount of free space in the storage pool specified the the params.
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) 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) GetByID ¶
GetByID retrives a volume.Info that has an id that matches the CSI volume id. Matches the LINSTOR resource name.
func (*Linstor) GetByName ¶
GetByName retrives a volume.Info that has a name that matches the CSI volume Name, not nessesarily the LINSTOR resource name or UUID.
func (*Linstor) GetSnapByID ¶ added in v0.8.0
GetSnapByID retrieves a pointer to a volume.SnapInfo by its id.
func (*Linstor) GetSnapByName ¶ added in v0.8.0
GetSnapByName retrieves a pointer to a volume.SnapInfo by its name.
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.
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) ListVolumes ¶ added in v0.8.0
ListVolumes returns all volumes that have metadata that is understandable by this plugin, so volumes from multiple compatible plugins may be returned.
func (*Linstor) Mount ¶
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
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.
func (*Linstor) Unmount ¶
Unmount unmounts the target. Operates locally on the machines where it is called.
func (*Linstor) VolFromSnap ¶ added in v0.8.0
VolFromSnap creates the volume using the data contained within the snapshot.
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) CanonicalizeSnapshotName ¶ added in v0.8.0
func (s *MockStorage) CanonicalizeSnapshotName(ctx context.Context, suggestedName string) string
func (*MockStorage) CapacityBytes ¶ added in v0.8.0
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) GetAssignmentOnNode ¶
func (s *MockStorage) GetAssignmentOnNode(ctx context.Context, vol *volume.Info, node string) (*volume.Assignment, error)
func (*MockStorage) GetSnapByID ¶ added in v0.8.0
func (*MockStorage) GetSnapByName ¶ added in v0.8.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