Documentation ¶
Index ¶
- Variables
- type LogicalVolumeService
- func (s *LogicalVolumeService) CreateSnapshot(ctx context.Context, node, dc, sourceVol, sname, accessType string, ...) (string, error)
- func (s *LogicalVolumeService) CreateVolume(ctx context.Context, node, dc, oc, name, sourceName string, requestGb int64) (string, error)
- func (s *LogicalVolumeService) DeleteVolume(ctx context.Context, volumeID string) error
- func (s *LogicalVolumeService) ExpandVolume(ctx context.Context, volumeID string, requestGb int64) error
- func (s *LogicalVolumeService) GetVolume(ctx context.Context, volumeID string) (*topolvmv1.LogicalVolume, error)
- func (s *LogicalVolumeService) UpdateCurrentSize(ctx context.Context, volumeID string, size *resource.Quantity) error
- func (s *LogicalVolumeService) UpdateSpecSize(ctx context.Context, volumeID string, size *resource.Quantity) error
- type NodeService
- func (s NodeService) GetCapacityByName(ctx context.Context, name, deviceClass string) (int64, error)
- func (s NodeService) GetCapacityByTopologyLabel(ctx context.Context, topology, dc string) (int64, error)
- func (s NodeService) GetMaxCapacity(ctx context.Context, deviceClass string) (string, int64, error)
- func (s NodeService) GetTotalCapacity(ctx context.Context, dc string) (int64, error)
Constants ¶
This section is empty.
Variables ¶
var ErrDeviceClassNotFound = errors.New("device class not found")
var ErrNodeNotFound = errors.New("node not found")
ErrNodeNotFound represents the error that node is not found.
var ErrVolumeNotFound = errors.New("VolumeID is not found")
ErrVolumeNotFound represents the specified volume is not found.
Functions ¶
This section is empty.
Types ¶
type LogicalVolumeService ¶
type LogicalVolumeService struct {
// contains filtered or unexported fields
}
LogicalVolumeService represents service for LogicalVolume.
func NewLogicalVolumeService ¶
func NewLogicalVolumeService(mgr manager.Manager) (*LogicalVolumeService, error)
NewLogicalVolumeService returns LogicalVolumeService.
func (*LogicalVolumeService) CreateSnapshot ¶ added in v0.13.0
func (s *LogicalVolumeService) CreateSnapshot(ctx context.Context, node, dc, sourceVol, sname, accessType string, snapSize resource.Quantity) (string, error)
CreateSnapshot creates a snapshot of existing volume.
func (*LogicalVolumeService) CreateVolume ¶
func (s *LogicalVolumeService) CreateVolume(ctx context.Context, node, dc, oc, name, sourceName string, requestGb int64) (string, error)
CreateVolume creates volume
func (*LogicalVolumeService) DeleteVolume ¶
func (s *LogicalVolumeService) DeleteVolume(ctx context.Context, volumeID string) error
DeleteVolume deletes volume
func (*LogicalVolumeService) ExpandVolume ¶
func (s *LogicalVolumeService) ExpandVolume(ctx context.Context, volumeID string, requestGb int64) error
ExpandVolume expands volume
func (*LogicalVolumeService) GetVolume ¶
func (s *LogicalVolumeService) GetVolume(ctx context.Context, volumeID string) (*topolvmv1.LogicalVolume, error)
GetVolume returns LogicalVolume by volume ID.
func (*LogicalVolumeService) UpdateCurrentSize ¶
func (s *LogicalVolumeService) UpdateCurrentSize(ctx context.Context, volumeID string, size *resource.Quantity) error
UpdateCurrentSize updates .Status.CurrentSize of LogicalVolume.
func (*LogicalVolumeService) UpdateSpecSize ¶
func (s *LogicalVolumeService) UpdateSpecSize(ctx context.Context, volumeID string, size *resource.Quantity) error
UpdateSpecSize updates .Spec.Size of LogicalVolume.
type NodeService ¶
type NodeService struct {
// contains filtered or unexported fields
}
NodeService represents node service.
func NewNodeService ¶
func NewNodeService(r client.Reader) *NodeService
NewNodeService returns NodeService.
func (NodeService) GetCapacityByName ¶
func (s NodeService) GetCapacityByName(ctx context.Context, name, deviceClass string) (int64, error)
GetCapacityByName returns VG capacity of specified node by name.
func (NodeService) GetCapacityByTopologyLabel ¶
func (s NodeService) GetCapacityByTopologyLabel(ctx context.Context, topology, dc string) (int64, error)
GetCapacityByTopologyLabel returns VG capacity of specified node by TopoLVM's topology label.
func (NodeService) GetMaxCapacity ¶
GetMaxCapacity returns max VG capacity among nodes.
func (NodeService) GetTotalCapacity ¶
GetTotalCapacity returns total VG capacity of all nodes.