client

package
v0.0.0-...-3425d69 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

View Source
const (
	GRPCServiceTimeout     = 3 * time.Minute
	GRPCServiceMedTimeout  = 24 * time.Hour
	GRPCServiceLongTimeout = 72 * time.Hour
)

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 BackupRestoreRequest struct {
	BackupUrl       string
	EngineName      string
	ReplicaName     string
	SnapshotName    string
	Credential      map[string]string
	ConcurrentLimit int32
}

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) EngineBackupRestoreFinish

func (c *SPDKClient) EngineBackupRestoreFinish(engineName string) error

func (*SPDKClient) EngineBackupStatus

func (c *SPDKClient) EngineBackupStatus(backupName, engineName, replicaAddress string) (*spdkrpc.BackupStatusResponse, error)

func (*SPDKClient) EngineCreate

func (c *SPDKClient) EngineCreate(name, volumeName, frontend string, specSize uint64, replicaAddressMap map[string]string, portCount int32) (*api.Engine, error)

func (*SPDKClient) EngineDelete

func (c *SPDKClient) EngineDelete(name string) error

func (*SPDKClient) EngineGet

func (c *SPDKClient) EngineGet(name string) (*api.Engine, 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) EngineSnapshotCreate

func (c *SPDKClient) EngineSnapshotCreate(name, snapshotName string, opts *api.SnapshotOptions) (string, error)

func (*SPDKClient) EngineSnapshotDelete

func (c *SPDKClient) EngineSnapshotDelete(name, snapshotName string) error

func (*SPDKClient) EngineSnapshotRevert

func (c *SPDKClient) EngineSnapshotRevert(name, snapshotName 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 (c *SPDKClient) ReplicaCreate(name, lvsName, lvsUUID string, specSize uint64, exposeRequired bool, portCount int32) (*api.Replica, error)

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, unexposeRequired bool) 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) error

func (*SPDKClient) ReplicaRebuildingDstStart

func (c *SPDKClient) ReplicaRebuildingDstStart(replicaName string, exposeRequired bool) (dstRebuildingLvolAddress string, err error)

ReplicaRebuildingDstStart asks the rebuilding replicas to expose the rebuilding lvol as a nvmf bdev if the source replica and the destination replica are on the different nodes. It returns an address <IP>:<Port> of the rebuilding destination bdev. If the source replica and the destination replicas are on the same node, the rebuilding lvol won't be exposed as a nvmf bdev and <port> will be zero.

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

func (*SPDKClient) ReplicaRebuildingSrcStart

func (c *SPDKClient) ReplicaRebuildingSrcStart(srcReplicaName, dstReplicaName, dstRebuildingLvolAddress string) error

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) ReplicaSnapshotRevert

func (c *SPDKClient) ReplicaSnapshotRevert(name, snapshotName string) error

func (*SPDKClient) ReplicaSnapshotShallowCopy

func (c *SPDKClient) ReplicaSnapshotShallowCopy(srcReplicaName, 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

Jump to

Keyboard shortcuts

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