engineapi

package
v1.3.3-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CurrentBackingImageManagerAPIVersion = 3
	MinBackingImageManagerAPIVersion     = 3
	UnknownBackingImageManagerAPIVersion = 0
)
View Source
const (
	BackupMonitorSyncPeriod = 2 * time.Second

	// BackupMonitorMaxRetryPeriod is the maximum retry period when backup monitor routine
	// encounters an error and backup stays in Pending state
	BackupMonitorMaxRetryPeriod = 24 * time.Hour
)
View Source
const (
	ProcessStateInProgress = "in_progress"
	ProcessStateComplete   = "complete"
	ProcessStateError      = "error"

	ErrNotImplement = "not implemented"
)

Should be the same values as in https://github.com/longhorn/longhorn-engine/blob/master/pkg/types/types.go

View Source
const (
	CurrentInstanceManagerAPIVersion = 2
	MinInstanceManagerAPIVersion     = 1
	UnknownInstanceManagerAPIVersion = 0

	CurrentInstanceManagerProxyAPIVersion = 2
	MinInstanceManagerProxyAPIVersion     = 1
	UnknownInstanceManagerProxyAPIVersion = 0
	// UnsupportInstanceManagerProxyAPIVersion means the instance manager without the proxy client (Longhorn release before v1.3.0)
	UnsupportInstanceManagerProxyAPIVersion = 0

	DefaultEnginePortCount  = 1
	DefaultReplicaPortCount = 15

	DefaultPortArg         = "--listen,0.0.0.0:"
	DefaultTerminateSignal = "SIGHUP"

	// IncompatibleInstanceManagerAPIVersion means the instance manager version in v0.7.0
	IncompatibleInstanceManagerAPIVersion = -1
	DeprecatedInstanceManagerBinaryName   = "longhorn-instance-manager"
)
View Source
const (
	// CurrentCLIVersion indicates the default API version manager used to talk with the
	// engine, including `longhorn-engine` and `longhorn-instance-manager`
	CurrentCLIVersion = 6
	// MinCLIVersion indicates the Min API version manager used to talk with the
	// engine.
	MinCLIVersion = 3

	CLIVersionFour = 4
	CLIVersionFive = 5

	InstanceManagerDefaultPort      = 8500
	InstanceManagerProxyDefaultPort = InstanceManagerDefaultPort + 1

	BackingImageManagerDefaultPort    = 8000
	BackingImageDataSourceDefaultPort = 8000
	BackingImageSyncServerDefaultPort = 8001

	DefaultISCSIPort = "3260"
	DefaultISCSILUN  = "1"

	MaxPollCount = 60
	MinPollCount = 1
	PollInterval = 1 * time.Second

	BackingImageDataSourcePollInterval = 3 * PollInterval

	MaxMonitorRetryCount = 10
)
View Source
const (
	VolumeHeadName = "volume-head"
)

Variables

This section is empty.

Functions

func CheckBackingImageManagerCompatibilty added in v1.1.1

func CheckBackingImageManagerCompatibilty(bimMinVersion, bimVersion int) error

func CheckCLICompatibilty

func CheckCLICompatibilty(cliVersion, cliMinVersion int) error

func CheckInstanceManagerCompatibilty added in v0.8.0

func CheckInstanceManagerCompatibilty(imMinVersion, imVersion int) error

func CheckInstanceManagerProxyCompatibility added in v1.3.0

func CheckInstanceManagerProxyCompatibility(im *longhorn.InstanceManager) error

func CheckInstanceManagerProxySupport added in v1.3.0

func CheckInstanceManagerProxySupport(im *longhorn.InstanceManager) error

func ConvertEngineBackupState added in v1.2.3

func ConvertEngineBackupState(state string) longhorn.BackupState

ConvertEngineBackupState converts longhorn engine backup state to Backup CR state

func GetAddressFromBackendReplicaURL added in v0.6.0

func GetAddressFromBackendReplicaURL(url string) string

func GetBackendReplicaURL added in v0.6.0

func GetBackendReplicaURL(address string) string

func GetDeprecatedInstanceManagerBinary added in v0.8.0

func GetDeprecatedInstanceManagerBinary(image string) string

func GetEngineEndpoint added in v1.1.3

func GetEngineEndpoint(volume *Volume, ip string) (string, error)

func GetEngineProcessFrontend added in v0.8.0

func GetEngineProcessFrontend(volumeFrontend longhorn.VolumeFrontend) (string, error)

func ValidateReplicaURL

func ValidateReplicaURL(url string) error

Types

type BackingImageDataSourceClient added in v1.2.0

type BackingImageDataSourceClient struct {
	// contains filtered or unexported fields
}

func NewBackingImageDataSourceClient added in v1.2.0

func NewBackingImageDataSourceClient(ip string) *BackingImageDataSourceClient

func (*BackingImageDataSourceClient) Get added in v1.2.0

func (*BackingImageDataSourceClient) Transfer added in v1.3.0

func (c *BackingImageDataSourceClient) Transfer() error

type BackingImageDataSourceInfo added in v1.2.0

type BackingImageDataSourceInfo struct {
	DiskUUID   string            `json:"diskUUID"`
	SourceType string            `json:"sourceType"`
	Parameters map[string]string `json:"parameters"`

	Name            string `json:"name"`
	UUID            string `json:"uuid"`
	FilePath        string `json:"filePath"`
	State           string `json:"state"`
	Size            int64  `json:"size"`
	Progress        int    `json:"progress"`
	ProcessedSize   int64  `json:"processedSize"`
	CurrentChecksum string `json:"currentChecksum"`
	Message         string `json:"message"`
}

type BackingImageManagerClient added in v1.1.1

type BackingImageManagerClient struct {
	// contains filtered or unexported fields
}

func NewBackingImageManagerClient added in v1.1.1

func NewBackingImageManagerClient(bim *longhorn.BackingImageManager) (*BackingImageManagerClient, error)

func (*BackingImageManagerClient) Delete added in v1.1.1

func (c *BackingImageManagerClient) Delete(name, uuid string) error

func (*BackingImageManagerClient) Fetch added in v1.2.0

func (c *BackingImageManagerClient) Fetch(name, uuid, checksum, dataSourceAddress string, size int64) (*longhorn.BackingImageFileInfo, error)

func (*BackingImageManagerClient) Get added in v1.1.1

func (*BackingImageManagerClient) List added in v1.1.1

func (*BackingImageManagerClient) PrepareDownload added in v1.3.0

func (c *BackingImageManagerClient) PrepareDownload(name, uuid string) (string, string, error)

func (*BackingImageManagerClient) Sync added in v1.1.1

func (c *BackingImageManagerClient) Sync(name, uuid, checksum, fromHost string, size int64) (*longhorn.BackingImageFileInfo, error)

func (*BackingImageManagerClient) VersionGet added in v1.1.1

func (c *BackingImageManagerClient) VersionGet() (int, int, error)

func (*BackingImageManagerClient) Watch added in v1.1.1

type Backup

type Backup struct {
	Name                   string               `json:"name"`
	State                  longhorn.BackupState `json:"state"`
	URL                    string               `json:"url"`
	SnapshotName           string               `json:"snapshotName"`
	SnapshotCreated        string               `json:"snapshotCreated"`
	Created                string               `json:"created"`
	Size                   string               `json:"size"`
	Labels                 map[string]string    `json:"labels"`
	VolumeName             string               `json:"volumeName"`
	VolumeSize             string               `json:"volumeSize"`
	VolumeCreated          string               `json:"volumeCreated"`
	VolumeBackingImageName string               `json:"volumeBackingImageName"`
	Messages               map[string]string    `json:"messages"`
}

type BackupCreateInfo added in v0.6.0

type BackupCreateInfo struct {
	BackupID       string
	ReplicaAddress string
	IsIncremental  bool
}

type BackupMonitor added in v1.2.3

type BackupMonitor struct {
	// contains filtered or unexported fields
}

func NewBackupMonitor added in v1.2.3

func NewBackupMonitor(logger logrus.FieldLogger,
	backup *longhorn.Backup, volume *longhorn.Volume, backupTargetClient *BackupTargetClient,
	biChecksum string, engine *longhorn.Engine, engineClientProxy EngineClientProxy,
	syncCallback func(key string)) (*BackupMonitor, error)

func (*BackupMonitor) Close added in v1.2.3

func (m *BackupMonitor) Close()

func (*BackupMonitor) GetBackupStatus added in v1.2.3

func (m *BackupMonitor) GetBackupStatus() longhorn.BackupStatus

type BackupTarget

type BackupTarget struct {
	BackupTargetURL  string `json:"backupTargetURL"`
	CredentialSecret string `json:"credentialSecret"`
	PollInterval     string `json:"pollInterval"`
	Available        bool   `json:"available"`
	Message          string `json:"message"`
}

type BackupTargetClient added in v1.2.0

type BackupTargetClient struct {
	Image      string
	URL        string
	Credential map[string]string
}

func NewBackupTargetClient added in v1.2.0

func NewBackupTargetClient(defaultEngineImage, url string, credential map[string]string) *BackupTargetClient

NewBackupTargetClient returns the backup target client

func (*BackupTargetClient) BackupConfigMetaGet added in v1.3.0

func (btc *BackupTargetClient) BackupConfigMetaGet(url string, credential map[string]string) (*ConfigMetadata, error)

BackupConfigMetaGet returns the config metadata with the given URL

func (*BackupTargetClient) BackupDelete added in v1.3.0

func (btc *BackupTargetClient) BackupDelete(backupURL string, credential map[string]string) error

BackupDelete deletes the backup from the remote backup target

func (*BackupTargetClient) BackupGet added in v1.3.0

func (btc *BackupTargetClient) BackupGet(backupConfigURL string, credential map[string]string) (*Backup, error)

BackupGet inspects a backup config with the given backup config URL

func (*BackupTargetClient) BackupNameList added in v1.3.0

func (btc *BackupTargetClient) BackupNameList(destURL, volumeName string, credential map[string]string) ([]string, error)

BackupNameList returns a list of backup names

func (*BackupTargetClient) BackupVolumeDelete added in v1.3.0

func (btc *BackupTargetClient) BackupVolumeDelete(destURL, volumeName string, credential map[string]string) error

BackupVolumeDelete deletes the backup volume from the remote backup target

func (*BackupTargetClient) BackupVolumeGet added in v1.3.0

func (btc *BackupTargetClient) BackupVolumeGet(backupVolumeURL string, credential map[string]string) (*BackupVolume, error)

BackupVolumeGet inspects a backup volume config with the given volume config URL

func (*BackupTargetClient) BackupVolumeNameList added in v1.3.0

func (btc *BackupTargetClient) BackupVolumeNameList(destURL string, credential map[string]string) ([]string, error)

BackupVolumeNameList returns a list of backup volume names

func (*BackupTargetClient) ExecuteEngineBinary added in v1.2.0

func (btc *BackupTargetClient) ExecuteEngineBinary(args ...string) (string, error)

func (*BackupTargetClient) ExecuteEngineBinaryWithoutTimeout added in v1.2.0

func (btc *BackupTargetClient) ExecuteEngineBinaryWithoutTimeout(args ...string) (string, error)

func (*BackupTargetClient) LonghornEngineBinary added in v1.2.0

func (btc *BackupTargetClient) LonghornEngineBinary() string

type BackupVolume

type BackupVolume struct {
	Name                 string             `json:"name"`
	Size                 string             `json:"size"`
	Labels               map[string]string  `json:"labels"`
	Created              string             `json:"created"`
	LastBackupName       string             `json:"lastBackupName"`
	LastBackupAt         string             `json:"lastBackupAt"`
	DataStored           string             `json:"dataStored"`
	Messages             map[string]string  `json:"messages"`
	Backups              map[string]*Backup `json:"backups"`
	BackingImageName     string             `json:"backingImageName"`
	BackingImageChecksum string             `json:"backingImageChecksum"`
}

type ConfigMetadata added in v1.2.0

type ConfigMetadata struct {
	ModificationTime time.Time `json:"modificationTime"`
}

type Controller

type Controller struct {
	URL    string
	NodeID string
}

type EngineBinary added in v1.3.0

type EngineBinary struct {
	// contains filtered or unexported fields
}

func (*EngineBinary) BackupRestore added in v1.3.0

func (e *EngineBinary) BackupRestore(engine *longhorn.Engine, backupTarget, backupName, backupVolumeName, lastRestored string, credential map[string]string) error

BackupRestore calls engine binary TODO: Deprecated, replaced by gRPC proxy

func (*EngineBinary) BackupRestoreStatus added in v1.3.0

func (e *EngineBinary) BackupRestoreStatus(*longhorn.Engine) (map[string]*longhorn.RestoreStatus, error)

BackupRestoreStatus calls engine binary TODO: Deprecated, replaced by gRPC proxy

func (*EngineBinary) Close added in v1.3.0

func (e *EngineBinary) Close()

Close engine proxy client connection. Do not panic this method because this is could be called by the fallback client.

func (*EngineBinary) ExecuteEngineBinary added in v1.3.0

func (e *EngineBinary) ExecuteEngineBinary(args ...string) (string, error)

func (*EngineBinary) ExecuteEngineBinaryWithTimeout added in v1.3.0

func (e *EngineBinary) ExecuteEngineBinaryWithTimeout(timeout time.Duration, args ...string) (string, error)

func (*EngineBinary) ExecuteEngineBinaryWithoutTimeout added in v1.3.0

func (e *EngineBinary) ExecuteEngineBinaryWithoutTimeout(envs []string, args ...string) (string, error)

func (*EngineBinary) LonghornEngineBinary added in v1.3.0

func (e *EngineBinary) LonghornEngineBinary() string

func (*EngineBinary) Name added in v1.3.0

func (e *EngineBinary) Name() string

func (*EngineBinary) ReplicaAdd added in v1.3.0

func (e *EngineBinary) ReplicaAdd(engine *longhorn.Engine, url string, isRestoreVolume bool) error

ReplicaAdd calls engine binary TODO: Deprecated, replaced by gRPC proxy

func (*EngineBinary) ReplicaList added in v1.3.0

func (e *EngineBinary) ReplicaList(*longhorn.Engine) (map[string]*Replica, error)

ReplicaList calls engine binary TODO: Deprecated, replaced by gRPC proxy

func (*EngineBinary) ReplicaRebuildStatus added in v1.3.0

func (e *EngineBinary) ReplicaRebuildStatus(*longhorn.Engine) (map[string]*longhorn.RebuildStatus, error)

ReplicaRebuildStatus calls engine binary TODO: Deprecated, replaced by gRPC proxy

func (*EngineBinary) ReplicaRebuildVerify added in v1.3.0

func (e *EngineBinary) ReplicaRebuildVerify(engine *longhorn.Engine, url string) error

ReplicaRebuildVerify calls engine binary TODO: Deprecated, replaced by gRPC proxy

func (*EngineBinary) ReplicaRemove added in v1.3.0

func (e *EngineBinary) ReplicaRemove(engine *longhorn.Engine, url string) error

ReplicaRemove calls engine binary TODO: Deprecated, replaced by gRPC proxy

func (*EngineBinary) SnapshotBackup added in v1.3.0

func (e *EngineBinary) SnapshotBackup(engine *longhorn.Engine,
	snapName, backupName, backupTarget,
	backingImageName, backingImageChecksum string,
	labels, credential map[string]string) (string, string, error)

SnapshotBackup calls engine binary TODO: Deprecated, replaced by gRPC proxy

func (*EngineBinary) SnapshotBackupStatus added in v1.3.0

func (e *EngineBinary) SnapshotBackupStatus(engine *longhorn.Engine, backupName, replicaAddress string) (*longhorn.EngineBackupStatus, error)

SnapshotBackupStatus calls engine binary TODO: Deprecated, replaced by gRPC proxy

func (*EngineBinary) SnapshotClone added in v1.3.0

func (e *EngineBinary) SnapshotClone(engine *longhorn.Engine, snapshotName, fromControllerAddress string) error

SnapshotClone calls engine binary TODO: Deprecated, replaced by gRPC proxy

func (*EngineBinary) SnapshotCloneStatus added in v1.3.0

func (e *EngineBinary) SnapshotCloneStatus(*longhorn.Engine) (map[string]*longhorn.SnapshotCloneStatus, error)

SnapshotCloneStatus calls engine binary TODO: Deprecated, replaced by gRPC proxy

func (*EngineBinary) SnapshotCreate added in v1.3.0

func (e *EngineBinary) SnapshotCreate(engine *longhorn.Engine, name string, labels map[string]string) (string, error)

SnapshotCreate calls engine binary TODO: Deprecated, replaced by gRPC proxy

func (*EngineBinary) SnapshotDelete added in v1.3.0

func (e *EngineBinary) SnapshotDelete(engine *longhorn.Engine, name string) error

SnapshotDelete calls engine binary TODO: Deprecated, replaced by gRPC proxy

func (*EngineBinary) SnapshotGet added in v1.3.0

func (e *EngineBinary) SnapshotGet(engine *longhorn.Engine, name string) (*longhorn.SnapshotInfo, error)

SnapshotGet calls engine binary TODO: Deprecated, replaced by gRPC proxy

func (*EngineBinary) SnapshotList added in v1.3.0

func (e *EngineBinary) SnapshotList(*longhorn.Engine) (map[string]*longhorn.SnapshotInfo, error)

SnapshotList calls engine binary TODO: Deprecated, replaced by gRPC proxy

func (*EngineBinary) SnapshotPurge added in v1.3.0

func (e *EngineBinary) SnapshotPurge(*longhorn.Engine) error

SnapshotPurge calls engine binary TODO: Deprecated, replaced by gRPC proxy

func (*EngineBinary) SnapshotPurgeStatus added in v1.3.0

func (e *EngineBinary) SnapshotPurgeStatus(*longhorn.Engine) (map[string]*longhorn.PurgeStatus, error)

SnapshotPurgeStatus calls engine binary TODO: Deprecated, replaced by gRPC proxy

func (*EngineBinary) SnapshotRevert added in v1.3.0

func (e *EngineBinary) SnapshotRevert(engine *longhorn.Engine, name string) error

SnapshotRevert calls engine binary TODO: Deprecated, replaced by gRPC proxy

func (*EngineBinary) VersionGet added in v1.3.0

func (e *EngineBinary) VersionGet(engine *longhorn.Engine, clientOnly bool) (*EngineVersion, error)

VersionGet calls engine binary to get client version and request gRPC proxy for server version.

func (*EngineBinary) VolumeExpand added in v1.3.0

func (e *EngineBinary) VolumeExpand(engine *longhorn.Engine) error

VolumeExpand calls engine binary TODO: Deprecated, replaced by gRPC proxy

func (*EngineBinary) VolumeFrontendShutdown added in v1.3.0

func (e *EngineBinary) VolumeFrontendShutdown(*longhorn.Engine) error

VolumeFrontendShutdown calls engine binary TODO: Deprecated, replaced by gRPC proxy

func (*EngineBinary) VolumeFrontendStart added in v1.3.0

func (e *EngineBinary) VolumeFrontendStart(engine *longhorn.Engine) error

VolumeFrontendStart calls engine binary TODO: Deprecated, replaced by gRPC proxy

func (*EngineBinary) VolumeGet added in v1.3.0

func (e *EngineBinary) VolumeGet(*longhorn.Engine) (*Volume, error)

VolumeGet calls engine binary TODO: Deprecated, replaced by gRPC proxy

type EngineClient

type EngineClient interface {
	VersionGet(engine *longhorn.Engine, clientOnly bool) (*EngineVersion, error)

	VolumeGet(*longhorn.Engine) (*Volume, error)
	VolumeExpand(*longhorn.Engine) error

	VolumeFrontendStart(*longhorn.Engine) error
	VolumeFrontendShutdown(*longhorn.Engine) error

	ReplicaList(*longhorn.Engine) (map[string]*Replica, error)
	ReplicaAdd(engine *longhorn.Engine, url string, isRestoreVolume bool) error
	ReplicaRemove(engine *longhorn.Engine, url string) error
	ReplicaRebuildStatus(*longhorn.Engine) (map[string]*longhorn.RebuildStatus, error)
	ReplicaRebuildVerify(engine *longhorn.Engine, url string) error

	SnapshotCreate(engine *longhorn.Engine, name string, labels map[string]string) (string, error)
	SnapshotList(engine *longhorn.Engine) (map[string]*longhorn.SnapshotInfo, error)
	SnapshotGet(engine *longhorn.Engine, name string) (*longhorn.SnapshotInfo, error)
	SnapshotDelete(engine *longhorn.Engine, name string) error
	SnapshotRevert(engine *longhorn.Engine, name string) error
	SnapshotPurge(engine *longhorn.Engine) error
	SnapshotPurgeStatus(engine *longhorn.Engine) (map[string]*longhorn.PurgeStatus, error)
	SnapshotBackup(engine *longhorn.Engine, backupName, snapName, backupTarget, backingImageName, backingImageChecksum string, labels, credential map[string]string) (string, string, error)
	SnapshotBackupStatus(engine *longhorn.Engine, backupName, replicaAddress string) (*longhorn.EngineBackupStatus, error)
	SnapshotCloneStatus(engine *longhorn.Engine) (map[string]*longhorn.SnapshotCloneStatus, error)
	SnapshotClone(engine *longhorn.Engine, snapshotName, fromControllerAddress string) error

	BackupRestore(engine *longhorn.Engine, backupTarget, backupName, backupVolume, lastRestored string, credential map[string]string) error
	BackupRestoreStatus(engine *longhorn.Engine) (map[string]*longhorn.RestoreStatus, error)
}

type EngineClientCollection

type EngineClientCollection interface {
	NewEngineClient(request *EngineClientRequest) (*EngineBinary, error)
}

type EngineClientProxy added in v1.3.0

type EngineClientProxy interface {
	EngineClient

	Close()
}

func GetCompatibleClient added in v1.3.0

func GetCompatibleClient(e *longhorn.Engine, fallBack interface{}, ds *datastore.DataStore, logger logrus.FieldLogger, proxyConnCounter util.Counter) (c EngineClientProxy, err error)

func NewEngineClientProxy added in v1.3.0

func NewEngineClientProxy(im *longhorn.InstanceManager, logger logrus.FieldLogger, proxyConnCounter util.Counter) (c EngineClientProxy, err error)

type EngineClientRequest

type EngineClientRequest struct {
	VolumeName  string
	EngineImage string
	IP          string
	Port        int
}

type EngineCollection

type EngineCollection struct{}

func (*EngineCollection) NewEngineClient

func (c *EngineCollection) NewEngineClient(request *EngineClientRequest) (*EngineBinary, error)

type EngineSimulator

type EngineSimulator struct {
	// contains filtered or unexported fields
}

func (*EngineSimulator) BackupRestore added in v0.6.0

func (e *EngineSimulator) BackupRestore(engine *longhorn.Engine, backupTarget, backupName, backupVolume, lastRestored string, credential map[string]string) error

func (*EngineSimulator) BackupRestoreStatus added in v0.6.0

func (e *EngineSimulator) BackupRestoreStatus(*longhorn.Engine) (map[string]*longhorn.RestoreStatus, error)

func (*EngineSimulator) IsGRPC added in v1.3.0

func (e *EngineSimulator) IsGRPC() bool

func (*EngineSimulator) Name

func (e *EngineSimulator) Name() string

func (*EngineSimulator) ReplicaAdd

func (e *EngineSimulator) ReplicaAdd(engine *longhorn.Engine, url string, isRestoreVolume bool) error

func (*EngineSimulator) ReplicaList

func (e *EngineSimulator) ReplicaList(*longhorn.Engine) (map[string]*Replica, error)

func (*EngineSimulator) ReplicaRebuildStatus added in v0.8.0

func (e *EngineSimulator) ReplicaRebuildStatus(*longhorn.Engine) (map[string]*longhorn.RebuildStatus, error)

func (*EngineSimulator) ReplicaRebuildVerify added in v1.1.0

func (e *EngineSimulator) ReplicaRebuildVerify(engine *longhorn.Engine, url string) error

func (*EngineSimulator) ReplicaRemove

func (e *EngineSimulator) ReplicaRemove(engine *longhorn.Engine, addr string) error

func (*EngineSimulator) SimulateStopReplica

func (e *EngineSimulator) SimulateStopReplica(addr string) error

func (*EngineSimulator) SnapshotBackup

func (e *EngineSimulator) SnapshotBackup(engine *longhorn.Engine, backupName, snapName, backupTarget, backingImageName, backingImageChecksum string, labels, credential map[string]string) (string, string, error)

func (*EngineSimulator) SnapshotBackupStatus added in v0.6.0

func (e *EngineSimulator) SnapshotBackupStatus(engine *longhorn.Engine, backupName, replicaAddress string) (*longhorn.EngineBackupStatus, error)

func (*EngineSimulator) SnapshotClone added in v1.2.0

func (e *EngineSimulator) SnapshotClone(engine *longhorn.Engine, snapshotName, fromControllerAddress string) error

func (*EngineSimulator) SnapshotCloneStatus added in v1.2.0

func (e *EngineSimulator) SnapshotCloneStatus(*longhorn.Engine) (map[string]*longhorn.SnapshotCloneStatus, error)

func (*EngineSimulator) SnapshotCreate

func (e *EngineSimulator) SnapshotCreate(engine *longhorn.Engine, name string, labels map[string]string) (string, error)

func (*EngineSimulator) SnapshotDelete

func (e *EngineSimulator) SnapshotDelete(engine *longhorn.Engine, name string) error

func (*EngineSimulator) SnapshotGet

func (e *EngineSimulator) SnapshotGet(engine *longhorn.Engine, name string) (*longhorn.SnapshotInfo, error)

func (*EngineSimulator) SnapshotList

func (e *EngineSimulator) SnapshotList(engine *longhorn.Engine) (map[string]*longhorn.SnapshotInfo, error)

func (*EngineSimulator) SnapshotPurge

func (e *EngineSimulator) SnapshotPurge(*longhorn.Engine) error

func (*EngineSimulator) SnapshotPurgeStatus added in v0.6.0

func (e *EngineSimulator) SnapshotPurgeStatus(*longhorn.Engine) (map[string]*longhorn.PurgeStatus, error)

func (*EngineSimulator) SnapshotRevert

func (e *EngineSimulator) SnapshotRevert(engine *longhorn.Engine, name string) error

func (*EngineSimulator) Start added in v1.3.0

func (*EngineSimulator) Stop added in v1.3.0

func (*EngineSimulator) VersionGet added in v1.3.0

func (e *EngineSimulator) VersionGet(engine *longhorn.Engine, clientOnly bool) (*EngineVersion, error)

func (*EngineSimulator) VolumeExpand added in v1.3.0

func (e *EngineSimulator) VolumeExpand(*longhorn.Engine) error

func (*EngineSimulator) VolumeFrontendShutdown added in v1.3.0

func (e *EngineSimulator) VolumeFrontendShutdown(*longhorn.Engine) error

func (*EngineSimulator) VolumeFrontendStart added in v1.3.0

func (e *EngineSimulator) VolumeFrontendStart(*longhorn.Engine) error

func (*EngineSimulator) VolumeGet added in v1.3.0

func (e *EngineSimulator) VolumeGet(*longhorn.Engine) (*Volume, error)

type EngineSimulatorCollection

type EngineSimulatorCollection struct {
	// contains filtered or unexported fields
}

func NewEngineSimulatorCollection

func NewEngineSimulatorCollection() *EngineSimulatorCollection

func (*EngineSimulatorCollection) CreateEngineSimulator

func (c *EngineSimulatorCollection) CreateEngineSimulator(request *EngineSimulatorRequest) error

func (*EngineSimulatorCollection) DeleteEngineSimulator

func (c *EngineSimulatorCollection) DeleteEngineSimulator(volumeName string) error

func (*EngineSimulatorCollection) GetEngineSimulator

func (c *EngineSimulatorCollection) GetEngineSimulator(volumeName string) (*EngineSimulator, error)

func (*EngineSimulatorCollection) NewEngineClient

func (c *EngineSimulatorCollection) NewEngineClient(request *EngineClientRequest) (EngineClient, error)

type EngineSimulatorRequest

type EngineSimulatorRequest struct {
	VolumeName     string
	VolumeSize     int64
	ControllerAddr string
	ReplicaAddrs   []string
}

type EngineVersion

type EngineVersion struct {
	ClientVersion *longhorn.EngineVersionDetails `json:"clientVersion"`
	ServerVersion *longhorn.EngineVersionDetails `json:"serverVersion"`
}

type InstanceManagerClient added in v0.8.0

type InstanceManagerClient struct {
	// contains filtered or unexported fields
}

func NewInstanceManagerClient added in v0.8.0

func NewInstanceManagerClient(im *longhorn.InstanceManager) (*InstanceManagerClient, error)

func (*InstanceManagerClient) Close added in v1.3.0

func (c *InstanceManagerClient) Close() error

func (*InstanceManagerClient) EngineProcessCreate added in v0.8.0

func (c *InstanceManagerClient) EngineProcessCreate(engineName, volumeName string, volumeSize, volumeCurrentSize int64,
	engineImage string, volumeFrontend longhorn.VolumeFrontend, replicaAddressMap map[string]string,
	revCounterDisabled bool, salvageRequested bool, sizeRequested bool) (*longhorn.InstanceProcess, error)

func (*InstanceManagerClient) EngineProcessUpgrade added in v0.8.0

func (c *InstanceManagerClient) EngineProcessUpgrade(engineName, volumeName string, volumeSize, volumeCurrentSize int64, engineImage string, volumeFrontend longhorn.VolumeFrontend, replicaAddressMap map[string]string, sizeRequested bool) (*longhorn.InstanceProcess, error)

func (*InstanceManagerClient) ProcessDelete added in v0.8.0

func (c *InstanceManagerClient) ProcessDelete(name string) error

func (*InstanceManagerClient) ProcessGet added in v0.8.0

func (c *InstanceManagerClient) ProcessGet(name string) (*longhorn.InstanceProcess, error)

func (*InstanceManagerClient) ProcessList added in v0.8.0

func (c *InstanceManagerClient) ProcessList() (map[string]longhorn.InstanceProcess, error)

func (*InstanceManagerClient) ProcessLog added in v0.8.0

func (c *InstanceManagerClient) ProcessLog(ctx context.Context, name string) (*imapi.LogStream, error)

ProcessLog returns a grpc stream that will be closed when the passed context is cancelled or the underlying grpc client is closed

func (*InstanceManagerClient) ProcessWatch added in v0.8.0

func (c *InstanceManagerClient) ProcessWatch(ctx context.Context) (*imapi.ProcessStream, error)

ProcessWatch returns a grpc stream that will be closed when the passed context is cancelled or the underlying grpc client is closed

func (*InstanceManagerClient) ReplicaProcessCreate added in v0.8.0

func (c *InstanceManagerClient) ReplicaProcessCreate(replicaName, engineImage, dataPath, backingImagePath string, size int64, revCounterDisabled bool) (*longhorn.InstanceProcess, error)

func (*InstanceManagerClient) VersionGet added in v0.8.0

func (c *InstanceManagerClient) VersionGet() (int, int, int, int, error)

type LauncherVolumeInfo

type LauncherVolumeInfo struct {
	Volume   string `json:"volume,omitempty"`
	Frontend string `json:"frontend,omitempty"`
	Endpoint string `json:"endpoint,omitempty"`
}

type Proxy added in v1.3.0

type Proxy struct {
	// contains filtered or unexported fields
}

func (*Proxy) BackupRestore added in v1.3.0

func (p *Proxy) BackupRestore(e *longhorn.Engine, backupTarget, backupName, backupVolumeName, lastRestored string, credential map[string]string) error

func (*Proxy) BackupRestoreStatus added in v1.3.0

func (p *Proxy) BackupRestoreStatus(e *longhorn.Engine) (status map[string]*longhorn.RestoreStatus, err error)

func (*Proxy) Close added in v1.3.0

func (p *Proxy) Close()

func (*Proxy) DirectToURL added in v1.3.0

func (p *Proxy) DirectToURL(e *longhorn.Engine) string

func (*Proxy) ReplicaAdd added in v1.3.0

func (p *Proxy) ReplicaAdd(e *longhorn.Engine, address string, restore bool) (err error)

func (*Proxy) ReplicaList added in v1.3.0

func (p *Proxy) ReplicaList(e *longhorn.Engine) (replicas map[string]*Replica, err error)

func (*Proxy) ReplicaRebuildStatus added in v1.3.0

func (p *Proxy) ReplicaRebuildStatus(e *longhorn.Engine) (status map[string]*longhorn.RebuildStatus, err error)

func (*Proxy) ReplicaRebuildVerify added in v1.3.0

func (p *Proxy) ReplicaRebuildVerify(e *longhorn.Engine, url string) (err error)

func (*Proxy) ReplicaRemove added in v1.3.0

func (p *Proxy) ReplicaRemove(e *longhorn.Engine, address string) (err error)

func (*Proxy) SnapshotBackup added in v1.3.0

func (p *Proxy) SnapshotBackup(e *longhorn.Engine,
	snapshotName, backupName, backupTarget,
	backingImageName, backingImageChecksum string,
	labels, credential map[string]string) (string, string, error)

func (*Proxy) SnapshotBackupStatus added in v1.3.0

func (p *Proxy) SnapshotBackupStatus(e *longhorn.Engine, backupName, replicaAddress string) (status *longhorn.EngineBackupStatus, err error)

func (*Proxy) SnapshotClone added in v1.3.0

func (p *Proxy) SnapshotClone(e *longhorn.Engine, name, fromController string) (err error)

func (*Proxy) SnapshotCloneStatus added in v1.3.0

func (p *Proxy) SnapshotCloneStatus(e *longhorn.Engine) (status map[string]*longhorn.SnapshotCloneStatus, err error)

func (*Proxy) SnapshotCreate added in v1.3.0

func (p *Proxy) SnapshotCreate(e *longhorn.Engine, name string, labels map[string]string) (string, error)

func (*Proxy) SnapshotDelete added in v1.3.0

func (p *Proxy) SnapshotDelete(e *longhorn.Engine, name string) (err error)

func (*Proxy) SnapshotGet added in v1.3.0

func (p *Proxy) SnapshotGet(e *longhorn.Engine, name string) (snapshot *longhorn.SnapshotInfo, err error)

func (*Proxy) SnapshotList added in v1.3.0

func (p *Proxy) SnapshotList(e *longhorn.Engine) (snapshots map[string]*longhorn.SnapshotInfo, err error)

func (*Proxy) SnapshotPurge added in v1.3.0

func (p *Proxy) SnapshotPurge(e *longhorn.Engine) (err error)

func (*Proxy) SnapshotPurgeStatus added in v1.3.0

func (p *Proxy) SnapshotPurgeStatus(e *longhorn.Engine) (status map[string]*longhorn.PurgeStatus, err error)

func (*Proxy) SnapshotRevert added in v1.3.0

func (p *Proxy) SnapshotRevert(e *longhorn.Engine, name string) (err error)

func (*Proxy) VersionGet added in v1.3.0

func (p *Proxy) VersionGet(e *longhorn.Engine, clientOnly bool) (version *EngineVersion, err error)

func (*Proxy) VolumeExpand added in v1.3.0

func (p *Proxy) VolumeExpand(e *longhorn.Engine) (err error)

func (*Proxy) VolumeFrontendShutdown added in v1.3.0

func (p *Proxy) VolumeFrontendShutdown(e *longhorn.Engine) (err error)

func (*Proxy) VolumeFrontendStart added in v1.3.0

func (p *Proxy) VolumeFrontendStart(e *longhorn.Engine) (err error)

func (*Proxy) VolumeGet added in v1.3.0

func (p *Proxy) VolumeGet(e *longhorn.Engine) (volume *Volume, err error)

type Replica

type Replica struct {
	URL  string
	Mode longhorn.ReplicaMode
}

type ReplicaError added in v1.0.1

type ReplicaError struct {
	Address string
	Message string
}

func (ReplicaError) Error added in v1.0.1

func (e ReplicaError) Error() string

type TaskError added in v1.0.1

type TaskError struct {
	ReplicaErrors []ReplicaError
}

func (TaskError) Error added in v1.0.1

func (e TaskError) Error() string

type Volume

type Volume struct {
	Name                  string `json:"name"`
	Size                  int64  `json:"size"`
	ReplicaCount          int    `json:"replicaCount"`
	Endpoint              string `json:"endpoint"`
	Frontend              string `json:"frontend"`
	FrontendState         string `json:"frontendState"`
	IsExpanding           bool   `json:"isExpanding"`
	LastExpansionError    string `json:"lastExpansionError"`
	LastExpansionFailedAt string `json:"lastExpansionFailedAt"`
}

Jump to

Keyboard shortcuts

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