client

package
v1.8.0-dev-20240825 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2024 License: Apache-2.0 Imports: 24 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// We want to have a slightly bigger timeout on the proxy client-side compared to the actual timeout in the engine/replica because the proxy server adds some delay to the flow
	GRPCServiceTimeout     = eclient.GRPCServiceCommonTimeout * 2
	GRPCServiceLongTimeout = eclient.GRPCServiceLongTimeout + GRPCServiceTimeout
)

Variables

View Source
var (
	ErrParameterFmt = "missing required %v parameter"
)

Functions

This section is empty.

Types

type BackupRestoreStatus

type BackupRestoreStatus struct {
	IsRestoring            bool
	LastRestored           string
	CurrentRestoringBackup string
	Progress               int
	Error                  string
	Filename               string
	State                  string
	BackupURL              string
}

type DiskServiceClient added in v1.5.0

type DiskServiceClient struct {
	DiskServiceContext
	// contains filtered or unexported fields
}

func NewDiskServiceClient added in v1.5.0

func NewDiskServiceClient(ctx context.Context, ctxCancel context.CancelFunc, serviceURL string, tlsConfig *tls.Config) (*DiskServiceClient, error)

NewDiskServiceClient creates a new DiskServiceClient.

func NewDiskServiceClientWithTLS added in v1.5.0

func NewDiskServiceClientWithTLS(ctx context.Context, ctxCancel context.CancelFunc, serviceURL, caFile, certFile, keyFile, peerName string) (*DiskServiceClient, error)

NewDiskServiceClientWithTLS creates a new DiskServiceClient with TLS

func (*DiskServiceClient) CheckConnection added in v1.5.4

func (c *DiskServiceClient) CheckConnection() error

func (*DiskServiceClient) Close added in v1.5.0

func (c *DiskServiceClient) Close() error

func (*DiskServiceClient) DiskCreate added in v1.5.0

func (c *DiskServiceClient) DiskCreate(diskType, diskName, diskUUID, diskPath, diskDriver string, blockSize int64) (*api.DiskInfo, 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 (*DiskServiceClient) DiskDelete added in v1.5.0

func (c *DiskServiceClient) DiskDelete(diskType, diskName, diskUUID, diskPath, diskDriver string) error

DiskDelete deletes the disk with the given name, disk name, disk UUID, disk path and disk driver.

func (*DiskServiceClient) DiskGet added in v1.5.0

func (c *DiskServiceClient) DiskGet(diskType, diskName, diskPath, diskDriver string) (*api.DiskInfo, error)

DiskGet returns the disk info with the given name and path.

func (*DiskServiceClient) DiskReplicaInstanceDelete added in v1.5.0

func (c *DiskServiceClient) DiskReplicaInstanceDelete(diskType, diskName, diskUUID, diskDriver, replciaInstanceName string) error

DiskReplicaInstanceDelete deletes the replica instance with the given name on the disk.

func (*DiskServiceClient) DiskReplicaInstanceList added in v1.5.0

func (c *DiskServiceClient) DiskReplicaInstanceList(diskType, diskName, diskDriver string) (map[string]*api.ReplicaStorageInstance, error)

func (*DiskServiceClient) VersionGet added in v1.5.0

VersionGet returns the disk service version.

type DiskServiceContext added in v1.5.0

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

type EngineBackupInfo

type EngineBackupInfo struct {
	Name                   string
	URL                    string
	SnapshotName           string
	SnapshotCreated        string
	Created                string
	Size                   int64
	Labels                 map[string]string
	IsIncremental          bool
	VolumeName             string
	VolumeSize             int64
	VolumeCreated          string
	VolumeBackingImageName string
	Messages               map[string]string
}

type EngineBackupVolumeInfo

type EngineBackupVolumeInfo struct {
	Name                 string
	Size                 int64
	Labels               map[string]string
	Created              string
	LastBackupName       string
	LastBackupAt         string
	DataStored           int64
	Messages             map[string]string
	Backups              map[string]*EngineBackupInfo
	BackingImageName     string
	BackingImageChecksum string
}

type EngineCreateRequest added in v1.5.0

type EngineCreateRequest struct {
	ReplicaAddressMap map[string]string
	Frontend          string
	InitiatorAddress  string
	TargetAddress     string
	UpgradeRequired   bool
}

type InstanceCreateRequest added in v1.5.0

type InstanceCreateRequest struct {
	DataEngine   string
	Name         string
	InstanceType string
	VolumeName   string
	Size         uint64
	PortCount    int
	PortArgs     []string

	Binary     string
	BinaryArgs []string

	Engine  EngineCreateRequest
	Replica ReplicaCreateRequest

	// Deprecated: replaced by DataEngine.
	BackendStoreDriver string
}

type InstanceServiceClient added in v1.5.0

type InstanceServiceClient struct {
	InstanceServiceContext
	// contains filtered or unexported fields
}

func NewInstanceServiceClient added in v1.5.0

func NewInstanceServiceClient(ctx context.Context, ctxCancel context.CancelFunc, serviceURL string, tlsConfig *tls.Config) (*InstanceServiceClient, error)

func NewInstanceServiceClientWithTLS added in v1.5.0

func NewInstanceServiceClientWithTLS(ctx context.Context, ctxCancel context.CancelFunc, serviceURL, caFile, certFile, keyFile, peerName string) (*InstanceServiceClient, error)

func (*InstanceServiceClient) CheckConnection added in v1.5.4

func (c *InstanceServiceClient) CheckConnection() error

func (*InstanceServiceClient) InstanceCreate added in v1.5.0

func (c *InstanceServiceClient) InstanceCreate(req *InstanceCreateRequest) (*api.Instance, error)

InstanceCreate creates an instance.

func (*InstanceServiceClient) InstanceDelete added in v1.5.0

func (c *InstanceServiceClient) InstanceDelete(dataEngine, name, instanceType, diskUUID string, cleanupRequired bool) (*api.Instance, error)

InstanceDelete deletes the instance by name.

func (*InstanceServiceClient) InstanceDeleteTarget added in v1.7.0

func (c *InstanceServiceClient) InstanceDeleteTarget(dataEngine, name, instanceType string) error

InstanceDeleteTarget delete target for an instance.

func (*InstanceServiceClient) InstanceGet added in v1.5.0

func (c *InstanceServiceClient) InstanceGet(dataEngine, name, instanceType string) (*api.Instance, error)

InstanceGet returns the instance by name.

func (*InstanceServiceClient) InstanceList added in v1.5.0

func (c *InstanceServiceClient) InstanceList() (map[string]*api.Instance, error)

func (*InstanceServiceClient) InstanceLog added in v1.5.0

func (c *InstanceServiceClient) InstanceLog(ctx context.Context, dataEngine, name, instanceType string) (*api.LogStream, error)

InstanceLog returns the log stream of an instance.

func (*InstanceServiceClient) InstanceReplace added in v1.5.0

func (c *InstanceServiceClient) InstanceReplace(dataEngine, name, instanceType, binary string, portCount int, args, portArgs []string, terminateSignal string) (*api.Instance, error)

InstanceReplace replaces an instance with a new one.

func (*InstanceServiceClient) InstanceResume added in v1.7.0

func (c *InstanceServiceClient) InstanceResume(dataEngine, name, instanceType string) error

InstanceResume suspends an instance.

func (*InstanceServiceClient) InstanceSuspend added in v1.7.0

func (c *InstanceServiceClient) InstanceSuspend(dataEngine, name, instanceType string) error

InstanceSuspend suspends an instance.

func (*InstanceServiceClient) InstanceSwitchOverTarget added in v1.7.0

func (c *InstanceServiceClient) InstanceSwitchOverTarget(dataEngine, name, instanceType, targetAddress string) error

InstanceSwitchOverTarget switches over the target for an instance.

func (*InstanceServiceClient) InstanceWatch added in v1.5.0

func (c *InstanceServiceClient) InstanceWatch(ctx context.Context) (*api.InstanceStream, error)

InstanceWatch watches for instance updates.

func (*InstanceServiceClient) LogGetFlags added in v1.7.0

func (c *InstanceServiceClient) LogGetFlags(dataEngine, service string) (string, error)

LogGetFlags returns the log flags of the service.

func (*InstanceServiceClient) LogGetLevel added in v1.7.0

func (c *InstanceServiceClient) LogGetLevel(dataEngine, service string) (string, error)

LogGetLevel returns the log level of the service.

func (*InstanceServiceClient) LogSetFlags added in v1.7.0

func (c *InstanceServiceClient) LogSetFlags(dataEngine, service, flags string) error

LogSetFlags sets the log flags of the service.x

func (*InstanceServiceClient) LogSetLevel added in v1.7.0

func (c *InstanceServiceClient) LogSetLevel(dataEngine, service, level string) error

LogSetLevel sets the log level of the service.

func (*InstanceServiceClient) VersionGet added in v1.5.0

func (c *InstanceServiceClient) VersionGet() (*meta.VersionOutput, error)

InstanceResume resumes an instance.

type InstanceServiceContext added in v1.5.0

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

func (InstanceServiceContext) Close added in v1.5.0

func (c InstanceServiceContext) Close() error

type Metrics

type Metrics struct {
	ReadThroughput  uint64
	WriteThroughput uint64
	ReadLatency     uint64
	WriteLatency    uint64
	ReadIOPS        uint64
	WriteIOPS       uint64
}

type ProcessManagerClient

type ProcessManagerClient struct {
	ProcessManagerServiceContext
	// contains filtered or unexported fields
}

func NewProcessManagerClient

func NewProcessManagerClient(ctx context.Context, ctxCancel context.CancelFunc, serviceURL string, tlsConfig *tls.Config) (*ProcessManagerClient, error)

func NewProcessManagerClientWithTLS

func NewProcessManagerClientWithTLS(ctx context.Context, ctxCancel context.CancelFunc, serviceURL, caFile, certFile, keyFile, peerName string) (*ProcessManagerClient, error)

func (*ProcessManagerClient) CheckConnection added in v1.5.4

func (c *ProcessManagerClient) CheckConnection() error

func (*ProcessManagerClient) ProcessCreate

func (c *ProcessManagerClient) ProcessCreate(name, binary string, portCount int, args, portArgs []string) (*rpc.ProcessResponse, error)

func (*ProcessManagerClient) ProcessDelete

func (c *ProcessManagerClient) ProcessDelete(name string) (*rpc.ProcessResponse, error)

func (*ProcessManagerClient) ProcessGet

func (c *ProcessManagerClient) ProcessGet(name string) (*rpc.ProcessResponse, error)

func (*ProcessManagerClient) ProcessList

func (c *ProcessManagerClient) ProcessList() (map[string]*rpc.ProcessResponse, error)

func (*ProcessManagerClient) ProcessLog

func (c *ProcessManagerClient) ProcessLog(ctx context.Context, name string) (*api.LogStream, error)

func (*ProcessManagerClient) ProcessReplace

func (c *ProcessManagerClient) ProcessReplace(name, binary string, portCount int, args, portArgs []string, terminateSignal string) (*rpc.ProcessResponse, error)

func (*ProcessManagerClient) ProcessWatch

func (c *ProcessManagerClient) ProcessWatch(ctx context.Context) (*api.ProcessStream, error)

func (*ProcessManagerClient) VersionGet

func (c *ProcessManagerClient) VersionGet() (*meta.VersionOutput, error)

type ProcessManagerServiceContext

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

func (ProcessManagerServiceContext) Close

type ProxyClient

type ProxyClient struct {
	ServiceURL string
	ServiceContext

	Version int
}

func NewProxyClient

func NewProxyClient(ctx context.Context, ctxCancel context.CancelFunc, address string, port int, tlsConfig *tls.Config) (*ProxyClient, error)

func NewProxyClientWithTLS added in v1.5.4

func NewProxyClientWithTLS(ctx context.Context, ctxCancel context.CancelFunc, address string, port int, caFile, certFile, keyFile, peerName string) (*ProxyClient, error)

func (*ProxyClient) BackupRestore

func (c *ProxyClient) BackupRestore(dataEngine, engineName, volumeName, serviceAddress, url, target,
	backupVolumeName string, envs []string, concurrentLimit int) (err error)

func (*ProxyClient) BackupRestoreFinish added in v1.6.0

func (c *ProxyClient) BackupRestoreFinish(dataEngine, engineName, volumeName, serviceAddress string) error

func (*ProxyClient) BackupRestoreStatus

func (c *ProxyClient) BackupRestoreStatus(dataEngine, engineName, volumeName, serviceAddress string) (status map[string]*BackupRestoreStatus, err error)

func (*ProxyClient) CheckConnection added in v1.5.4

func (c *ProxyClient) CheckConnection() error

func (*ProxyClient) CleanupBackupMountPoints added in v1.5.4

func (c *ProxyClient) CleanupBackupMountPoints() (err error)

func (*ProxyClient) ClientVersionGet

func (c *ProxyClient) ClientVersionGet() (version emeta.VersionOutput)

func (*ProxyClient) Close

func (c *ProxyClient) Close() error

func (*ProxyClient) MetricsGet

func (c *ProxyClient) MetricsGet(engineName, volumeName, serviceAddress string) (metrics *Metrics, err error)

func (*ProxyClient) RemountReadOnlyVolume added in v1.5.4

func (c *ProxyClient) RemountReadOnlyVolume(volumeName string) (err error)

func (*ProxyClient) ReplicaAdd

func (c *ProxyClient) ReplicaAdd(dataEngine, engineName, volumeName, serviceAddress, replicaName,
	replicaAddress string, restore bool, size, currentSize int64, fileSyncHTTPClientTimeout int,
	fastSync bool, localSync *etypes.FileLocalSync, grpcTimeoutSeconds int64) (err error)

func (*ProxyClient) ReplicaList

func (c *ProxyClient) ReplicaList(dataEngine, engineName, volumeName,
	serviceAddress string) (rInfoList []*etypes.ControllerReplicaInfo, err error)

func (*ProxyClient) ReplicaModeUpdate

func (c *ProxyClient) ReplicaModeUpdate(dataEngine, serviceAddress, replicaAddress string, mode string) (err error)

func (*ProxyClient) ReplicaRebuildingStatus

func (c *ProxyClient) ReplicaRebuildingStatus(dataEngine, engineName, volumeName,
	serviceAddress string) (status map[string]*ReplicaRebuildStatus, err error)

func (*ProxyClient) ReplicaRemove

func (c *ProxyClient) ReplicaRemove(dataEngine, serviceAddress, engineName, replicaAddress, replicaName string) (err error)

func (*ProxyClient) ReplicaVerifyRebuild

func (c *ProxyClient) ReplicaVerifyRebuild(dataEngine, engineName, volumeName, serviceAddress,
	replicaAddress, replicaName string) (err error)

func (*ProxyClient) ServerVersionGet

func (c *ProxyClient) ServerVersionGet(serviceAddress string) (version *emeta.VersionOutput, err error)

func (*ProxyClient) SnapshotBackup

func (c *ProxyClient) SnapshotBackup(dataEngine, engineName, volumeName, serviceAddress, backupName,
	snapshotName, backupTarget, backingImageName, backingImageChecksum, compressionMethod string, concurrentLimit int,
	storageClassName string, labels map[string]string, envs []string, parameters map[string]string) (backupID, replicaAddress string, err error)

func (*ProxyClient) SnapshotBackupStatus

func (c *ProxyClient) SnapshotBackupStatus(dataEngine, engineName, volumeName, serviceAddress, backupName,
	replicaAddress, replicaName string) (status *SnapshotBackupStatus, err error)

func (*ProxyClient) SnapshotClone

func (c *ProxyClient) SnapshotClone(dataEngine, engineName, volumeName, serviceAddress,
	snapshotName, fromEngineAddress, fromVolumeName, fromEngineName string, fileSyncHTTPClientTimeout int, grpcTimeoutSeconds int64) (err error)

func (*ProxyClient) SnapshotCloneStatus

func (c *ProxyClient) SnapshotCloneStatus(dataEngine, engineName, volumeName, serviceAddress string) (status map[string]*SnapshotCloneStatus, err error)

func (*ProxyClient) SnapshotHash

func (c *ProxyClient) SnapshotHash(dataEngine, engineName, volumeName, serviceAddress string,
	snapshotName string, rehash bool) (err error)

func (*ProxyClient) SnapshotHashStatus

func (c *ProxyClient) SnapshotHashStatus(dataEngine, engineName, volumeName, serviceAddress,
	snapshotName string) (status map[string]*SnapshotHashStatus, err error)

func (*ProxyClient) SnapshotList

func (c *ProxyClient) SnapshotList(dataEngine, engineName, volumeName,
	serviceAddress string) (snapshotDiskInfo map[string]*etypes.DiskInfo, err error)

func (*ProxyClient) SnapshotPurge

func (c *ProxyClient) SnapshotPurge(dataEngine, engineName, volumeName, serviceAddress string,
	skipIfInProgress bool) (err error)

func (*ProxyClient) SnapshotPurgeStatus

func (c *ProxyClient) SnapshotPurgeStatus(dataEngine, engineName, volumeName, serviceAddress string) (status map[string]*SnapshotPurgeStatus, err error)

func (*ProxyClient) SnapshotRemove

func (c *ProxyClient) SnapshotRemove(dataEngine, engineName, volumeName, serviceAddress string,
	names []string) (err error)

func (*ProxyClient) SnapshotRevert

func (c *ProxyClient) SnapshotRevert(dataEngine, engineName, volumeName, serviceAddress string,
	name string) (err error)

func (*ProxyClient) VolumeExpand

func (c *ProxyClient) VolumeExpand(dataEngine, engineName, volumeName, serviceAddress string,
	size int64) (err error)

func (*ProxyClient) VolumeFrontendShutdown

func (c *ProxyClient) VolumeFrontendShutdown(dataEngine, engineName, volumeName, serviceAddress string) (err error)

func (*ProxyClient) VolumeFrontendStart

func (c *ProxyClient) VolumeFrontendStart(dataEngine, engineName, volumeName, serviceAddress, frontendName string) (err error)

func (*ProxyClient) VolumeGet

func (c *ProxyClient) VolumeGet(dataEngine, engineName, volumeName, serviceAddress string) (info *etypes.VolumeInfo, err error)

func (*ProxyClient) VolumeSnapshot

func (c *ProxyClient) VolumeSnapshot(dataEngine, engineName, volumeName, serviceAddress,
	volumeSnapshotName string, labels map[string]string, freezeFilesystem bool) (snapshotName string, err error)

func (*ProxyClient) VolumeSnapshotMaxCountSet added in v1.6.0

func (c *ProxyClient) VolumeSnapshotMaxCountSet(dataEngine, engineName, volumeName,
	serviceAddress string, count int) (err error)

func (*ProxyClient) VolumeSnapshotMaxSizeSet added in v1.6.0

func (c *ProxyClient) VolumeSnapshotMaxSizeSet(dataEngine, engineName, volumeName,
	serviceAddress string, size int64) (err error)

func (*ProxyClient) VolumeUnmapMarkSnapChainRemovedSet

func (c *ProxyClient) VolumeUnmapMarkSnapChainRemovedSet(dataEngine, engineName, volumeName, serviceAddress string, enabled bool) (err error)

type ReplicaCreateRequest added in v1.5.0

type ReplicaCreateRequest struct {
	DiskName       string
	DiskUUID       string
	ExposeRequired bool
}

type ReplicaError

type ReplicaError struct {
	Address string
	Message string
}

func (ReplicaError) Error

func (e ReplicaError) Error() string

type ReplicaRebuildStatus

type ReplicaRebuildStatus struct {
	Error              string
	IsRebuilding       bool
	Progress           int
	State              string
	FromReplicaAddress string
}

type ServiceContext

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

func (ServiceContext) GetConnectionState

func (s ServiceContext) GetConnectionState() connectivity.State

type SnapshotBackupStatus

type SnapshotBackupStatus struct {
	Progress       int
	BackupURL      string
	Error          string
	SnapshotName   string
	State          string
	ReplicaAddress string
}

type SnapshotCloneStatus

type SnapshotCloneStatus struct {
	IsCloning          bool
	Error              string
	Progress           int
	State              string
	FromReplicaAddress string
	SnapshotName       string
}

type SnapshotHashStatus

type SnapshotHashStatus struct {
	State             string
	Checksum          string
	Error             string
	SilentlyCorrupted bool
}

type SnapshotPurgeStatus

type SnapshotPurgeStatus struct {
	Error     string
	IsPurging bool
	Progress  int
	State     string
}

type TaskError

type TaskError struct {
	ReplicaErrors []ReplicaError
}

func (TaskError) Error

func (e TaskError) Error() string

Jump to

Keyboard shortcuts

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