Documentation ¶
Index ¶
- Constants
- type BackupCreateRequest
- type BackupRestoreRequest
- type SPDKClient
- func (c *SPDKClient) DiskCreate(diskName, diskUUID, diskPath, diskDriver string, blockSize int64) (*spdkrpc.Disk, error)
- func (c *SPDKClient) DiskDelete(diskName, diskUUID, diskPath, diskDriver string) error
- func (c *SPDKClient) DiskGet(diskName, diskPath, diskDriver string) (*spdkrpc.Disk, error)
- func (c *SPDKClient) EngineBackupCreate(req *BackupCreateRequest) (*spdkrpc.BackupCreateResponse, error)
- func (c *SPDKClient) EngineBackupRestore(req *BackupRestoreRequest) error
- func (c *SPDKClient) EngineBackupStatus(backupName, engineName, replicaAddress string) (*spdkrpc.BackupStatusResponse, error)
- func (c *SPDKClient) EngineCreate(name, volumeName, frontend string, specSize uint64, ...) (*api.Engine, error)
- func (c *SPDKClient) EngineDelete(name string) error
- func (c *SPDKClient) EngineDeleteTarget(name string) error
- func (c *SPDKClient) EngineGet(name string) (*api.Engine, error)
- func (c *SPDKClient) EngineList() (map[string]*api.Engine, error)
- func (c *SPDKClient) EngineReplicaAdd(engineName, replicaName, replicaAddress string) error
- func (c *SPDKClient) EngineReplicaDelete(engineName, replicaName, replicaAddress string) error
- func (c *SPDKClient) EngineReplicaList(engineName string) (*spdkrpc.EngineReplicaListResponse, error)
- func (c *SPDKClient) EngineRestoreStatus(engineName string) (*spdkrpc.RestoreStatusResponse, error)
- func (c *SPDKClient) EngineResume(name string) error
- func (c *SPDKClient) EngineSnapshotCreate(name, snapshotName string) (string, error)
- func (c *SPDKClient) EngineSnapshotDelete(name, snapshotName string) error
- func (c *SPDKClient) EngineSnapshotPurge(name string) error
- func (c *SPDKClient) EngineSnapshotRevert(name, snapshotName string) error
- func (c *SPDKClient) EngineSuspend(name string) error
- func (c *SPDKClient) EngineSwitchOverTarget(name, targetAddress string) error
- func (c *SPDKClient) EngineWatch(ctx context.Context) (*api.EngineStream, error)
- func (c *SPDKClient) LogGetFlags() (string, error)
- func (c *SPDKClient) LogGetLevel() (string, error)
- func (c *SPDKClient) LogSetFlags(flags string) error
- func (c *SPDKClient) LogSetLevel(level string) error
- func (c *SPDKClient) ReplicaBackupCreate(req *BackupCreateRequest) (*spdkrpc.BackupCreateResponse, error)
- func (c *SPDKClient) ReplicaBackupRestore(req *BackupRestoreRequest) error
- func (c *SPDKClient) ReplicaBackupStatus(backupName string) (*spdkrpc.BackupStatusResponse, error)
- func (c *SPDKClient) ReplicaCreate(name, lvsName, lvsUUID string, specSize uint64, portCount int32) (*api.Replica, error)
- func (c *SPDKClient) ReplicaDelete(name string, cleanupRequired bool) error
- func (c *SPDKClient) ReplicaGet(name string) (*api.Replica, error)
- func (c *SPDKClient) ReplicaList() (map[string]*api.Replica, error)
- func (c *SPDKClient) ReplicaRebuildingDstFinish(replicaName string) error
- func (c *SPDKClient) ReplicaRebuildingDstShallowCopyCheck(dstReplicaName string) (resp *api.ReplicaRebuildingStatus, err error)
- func (c *SPDKClient) ReplicaRebuildingDstShallowCopyStart(dstReplicaName, snapshotName string) error
- func (c *SPDKClient) ReplicaRebuildingDstSnapshotCreate(name, snapshotName string, opts *api.SnapshotOptions) error
- func (c *SPDKClient) ReplicaRebuildingDstSnapshotRevert(name, snapshotName string) (dstRebuildingLvolAddress string, err error)
- func (c *SPDKClient) ReplicaRebuildingDstStart(...) (dstHeadLvolAddress string, err error)
- func (c *SPDKClient) ReplicaRebuildingSrcAttach(srcReplicaName, dstReplicaName, dstRebuildingLvolAddress string) error
- func (c *SPDKClient) ReplicaRebuildingSrcDetach(srcReplicaName, dstReplicaName string) error
- func (c *SPDKClient) ReplicaRebuildingSrcFinish(srcReplicaName, dstReplicaName string) error
- func (c *SPDKClient) ReplicaRebuildingSrcShallowCopyCheck(srcReplicaName, dstReplicaName, snapshotName string, shallowCopyOpId uint32) (state string, copiedClusters, totalClusters uint64, errorMsg string, err error)
- func (c *SPDKClient) ReplicaRebuildingSrcShallowCopyStart(srcReplicaName, snapshotName string) (uint32, error)
- func (c *SPDKClient) ReplicaRebuildingSrcStart(srcReplicaName, dstReplicaName, dstReplicaAddress, exposedSnapshotName string) (exposedSnapshotLvolAddress string, err error)
- func (c *SPDKClient) ReplicaRestoreStatus(replicaName string) (*spdkrpc.ReplicaRestoreStatusResponse, error)
- func (c *SPDKClient) ReplicaSnapshotCreate(name, snapshotName string, opts *api.SnapshotOptions) error
- func (c *SPDKClient) ReplicaSnapshotDelete(name, snapshotName string) error
- func (c *SPDKClient) ReplicaSnapshotPurge(name string) error
- func (c *SPDKClient) ReplicaSnapshotRevert(name, snapshotName string) error
- func (c *SPDKClient) ReplicaWatch(ctx context.Context) (*api.ReplicaStream, error)
- type SPDKServiceContext
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackupCreateRequest ¶
type BackupCreateRequest struct { BackupName string SnapshotName string VolumeName string EngineName string ReplicaName string Size uint64 BackupTarget string StorageClassName string BackingImageName string BackingImageChecksum string CompressionMethod string ConcurrentLimit int32 Labels []string Credential map[string]string }
type BackupRestoreRequest ¶
type SPDKClient ¶
type SPDKClient struct { SPDKServiceContext // contains filtered or unexported fields }
func NewSPDKClient ¶
func NewSPDKClient(serviceURL string) (*SPDKClient, error)
func (*SPDKClient) DiskCreate ¶
func (c *SPDKClient) DiskCreate(diskName, diskUUID, diskPath, diskDriver string, blockSize int64) (*spdkrpc.Disk, error)
DiskCreate creates a disk with the given name and path. diskUUID is optional, if not provided, it indicates the disk is newly added.
func (*SPDKClient) DiskDelete ¶
func (c *SPDKClient) DiskDelete(diskName, diskUUID, diskPath, diskDriver string) error
func (*SPDKClient) DiskGet ¶
func (c *SPDKClient) DiskGet(diskName, diskPath, diskDriver string) (*spdkrpc.Disk, error)
func (*SPDKClient) EngineBackupCreate ¶
func (c *SPDKClient) EngineBackupCreate(req *BackupCreateRequest) (*spdkrpc.BackupCreateResponse, error)
func (*SPDKClient) EngineBackupRestore ¶
func (c *SPDKClient) EngineBackupRestore(req *BackupRestoreRequest) error
func (*SPDKClient) EngineBackupStatus ¶
func (c *SPDKClient) EngineBackupStatus(backupName, engineName, replicaAddress string) (*spdkrpc.BackupStatusResponse, error)
func (*SPDKClient) EngineCreate ¶
func (*SPDKClient) EngineDelete ¶
func (c *SPDKClient) EngineDelete(name string) error
func (*SPDKClient) EngineDeleteTarget ¶
func (c *SPDKClient) EngineDeleteTarget(name string) error
func (*SPDKClient) EngineList ¶
func (c *SPDKClient) EngineList() (map[string]*api.Engine, error)
func (*SPDKClient) EngineReplicaAdd ¶
func (c *SPDKClient) EngineReplicaAdd(engineName, replicaName, replicaAddress string) error
func (*SPDKClient) EngineReplicaDelete ¶
func (c *SPDKClient) EngineReplicaDelete(engineName, replicaName, replicaAddress string) error
func (*SPDKClient) EngineReplicaList ¶
func (c *SPDKClient) EngineReplicaList(engineName string) (*spdkrpc.EngineReplicaListResponse, error)
func (*SPDKClient) EngineRestoreStatus ¶
func (c *SPDKClient) EngineRestoreStatus(engineName string) (*spdkrpc.RestoreStatusResponse, error)
func (*SPDKClient) EngineResume ¶
func (c *SPDKClient) EngineResume(name string) error
func (*SPDKClient) EngineSnapshotCreate ¶
func (c *SPDKClient) EngineSnapshotCreate(name, snapshotName string) (string, error)
func (*SPDKClient) EngineSnapshotDelete ¶
func (c *SPDKClient) EngineSnapshotDelete(name, snapshotName string) error
func (*SPDKClient) EngineSnapshotPurge ¶
func (c *SPDKClient) EngineSnapshotPurge(name string) error
func (*SPDKClient) EngineSnapshotRevert ¶
func (c *SPDKClient) EngineSnapshotRevert(name, snapshotName string) error
func (*SPDKClient) EngineSuspend ¶
func (c *SPDKClient) EngineSuspend(name string) error
func (*SPDKClient) EngineSwitchOverTarget ¶
func (c *SPDKClient) EngineSwitchOverTarget(name, targetAddress string) error
func (*SPDKClient) EngineWatch ¶
func (c *SPDKClient) EngineWatch(ctx context.Context) (*api.EngineStream, error)
func (*SPDKClient) LogGetFlags ¶
func (c *SPDKClient) LogGetFlags() (string, error)
func (*SPDKClient) LogGetLevel ¶
func (c *SPDKClient) LogGetLevel() (string, error)
func (*SPDKClient) LogSetFlags ¶
func (c *SPDKClient) LogSetFlags(flags string) error
func (*SPDKClient) LogSetLevel ¶
func (c *SPDKClient) LogSetLevel(level string) error
func (*SPDKClient) ReplicaBackupCreate ¶
func (c *SPDKClient) ReplicaBackupCreate(req *BackupCreateRequest) (*spdkrpc.BackupCreateResponse, error)
func (*SPDKClient) ReplicaBackupRestore ¶
func (c *SPDKClient) ReplicaBackupRestore(req *BackupRestoreRequest) error
func (*SPDKClient) ReplicaBackupStatus ¶
func (c *SPDKClient) ReplicaBackupStatus(backupName string) (*spdkrpc.BackupStatusResponse, error)
func (*SPDKClient) ReplicaCreate ¶
func (*SPDKClient) ReplicaDelete ¶
func (c *SPDKClient) ReplicaDelete(name string, cleanupRequired bool) error
func (*SPDKClient) ReplicaGet ¶
func (c *SPDKClient) ReplicaGet(name string) (*api.Replica, error)
func (*SPDKClient) ReplicaList ¶
func (c *SPDKClient) ReplicaList() (map[string]*api.Replica, error)
func (*SPDKClient) ReplicaRebuildingDstFinish ¶
func (c *SPDKClient) ReplicaRebuildingDstFinish(replicaName string) error
ReplicaRebuildingDstFinish asks the dst replica to reconstruct its snapshot tree and active chain, then detach that external src snapshot (if necessary). The engine should guarantee that there is no IO during the parent switch.
func (*SPDKClient) ReplicaRebuildingDstShallowCopyCheck ¶
func (c *SPDKClient) ReplicaRebuildingDstShallowCopyCheck(dstReplicaName string) (resp *api.ReplicaRebuildingStatus, err error)
func (*SPDKClient) ReplicaRebuildingDstShallowCopyStart ¶
func (c *SPDKClient) ReplicaRebuildingDstShallowCopyStart(dstReplicaName, snapshotName string) error
func (*SPDKClient) ReplicaRebuildingDstSnapshotCreate ¶
func (c *SPDKClient) ReplicaRebuildingDstSnapshotCreate(name, snapshotName string, opts *api.SnapshotOptions) error
func (*SPDKClient) ReplicaRebuildingDstSnapshotRevert ¶
func (c *SPDKClient) ReplicaRebuildingDstSnapshotRevert(name, snapshotName string) (dstRebuildingLvolAddress string, err error)
func (*SPDKClient) ReplicaRebuildingDstStart ¶
func (c *SPDKClient) ReplicaRebuildingDstStart(replicaName, srcReplicaName, srcReplicaAddress, externalSnapshotName, externalSnapshotAddress string, rebuildingSnapshotList []*api.Lvol) (dstHeadLvolAddress string, err error)
ReplicaRebuildingDstStart asks the dst replica to create a new head lvol based on the external snapshot of the src replica and blindly expose it as a NVMf bdev. It returns the new head lvol address <IP>:<Port>. Notice that input `externalSnapshotAddress` is the alias of the src snapshot lvol if src and dst have on the same IP, otherwise it's the NVMf address of the src snapshot lvol.
func (*SPDKClient) ReplicaRebuildingSrcAttach ¶
func (c *SPDKClient) ReplicaRebuildingSrcAttach(srcReplicaName, dstReplicaName, dstRebuildingLvolAddress string) error
func (*SPDKClient) ReplicaRebuildingSrcDetach ¶
func (c *SPDKClient) ReplicaRebuildingSrcDetach(srcReplicaName, dstReplicaName string) error
func (*SPDKClient) ReplicaRebuildingSrcFinish ¶
func (c *SPDKClient) ReplicaRebuildingSrcFinish(srcReplicaName, dstReplicaName string) error
ReplicaRebuildingSrcFinish asks the source replica to stop exposing the parent snapshot of the head (if necessary) and clean up the dst replica related cache It's not responsible for detaching rebuilding lvol of the dst replica
func (*SPDKClient) ReplicaRebuildingSrcShallowCopyCheck ¶
func (c *SPDKClient) ReplicaRebuildingSrcShallowCopyCheck(srcReplicaName, dstReplicaName, snapshotName string, shallowCopyOpId uint32) (state string, copiedClusters, totalClusters uint64, errorMsg string, err error)
ReplicaRebuildingSrcShallowCopyCheck asks the src replica to check the shallow copy progress and status via the shallow copy op ID returned by RebuildingSrcShallowCopyStart.
func (*SPDKClient) ReplicaRebuildingSrcShallowCopyStart ¶
func (c *SPDKClient) ReplicaRebuildingSrcShallowCopyStart(srcReplicaName, snapshotName string) (uint32, error)
ReplicaRebuildingSrcShallowCopyStart asks the src replica to start a shallow copy from its snapshot lvol to the dst rebuilding lvol. It returns the shallow copy op ID, which is for retrieving the shallow copy progress and status. The caller is responsible for storing the op ID.
func (*SPDKClient) ReplicaRebuildingSrcStart ¶
func (c *SPDKClient) ReplicaRebuildingSrcStart(srcReplicaName, dstReplicaName, dstReplicaAddress, exposedSnapshotName string) (exposedSnapshotLvolAddress string, err error)
ReplicaRebuildingSrcStart asks the source replica to check the parent snapshot of the head and expose it as a NVMf bdev if necessary. If the source replica and the destination replica have different IPs, the API will expose the snapshot lvol as a NVMf bdev and return the address <IP>:<Port>. Otherwise, the API will directly return the snapshot lvol alias.
func (*SPDKClient) ReplicaRestoreStatus ¶
func (c *SPDKClient) ReplicaRestoreStatus(replicaName string) (*spdkrpc.ReplicaRestoreStatusResponse, error)
func (*SPDKClient) ReplicaSnapshotCreate ¶
func (c *SPDKClient) ReplicaSnapshotCreate(name, snapshotName string, opts *api.SnapshotOptions) error
func (*SPDKClient) ReplicaSnapshotDelete ¶
func (c *SPDKClient) ReplicaSnapshotDelete(name, snapshotName string) error
func (*SPDKClient) ReplicaSnapshotPurge ¶
func (c *SPDKClient) ReplicaSnapshotPurge(name string) error
func (*SPDKClient) ReplicaSnapshotRevert ¶
func (c *SPDKClient) ReplicaSnapshotRevert(name, snapshotName string) error
func (*SPDKClient) ReplicaWatch ¶
func (c *SPDKClient) ReplicaWatch(ctx context.Context) (*api.ReplicaStream, error)
type SPDKServiceContext ¶
type SPDKServiceContext struct {
// contains filtered or unexported fields
}
func (*SPDKServiceContext) Close ¶
func (c *SPDKServiceContext) Close() error