hostutils

package
v0.3.9-9 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: Apache-2.0 Imports: 19 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ParamsError = fmt.Errorf("Delay task parse params error")
)

Functions

func DelayKubeTask

func DelayKubeTask(ctx context.Context, task workmanager.DelayTaskFunc, params interface{})

func DelayTask

func DelayTask(ctx context.Context, task workmanager.DelayTaskFunc, params interface{})

func DelayTaskWithWorker

func DelayTaskWithWorker(
	ctx context.Context, task workmanager.DelayTaskFunc,
	params interface{}, worker *appsrv.SWorkerManager,
)

func DelayTaskWithoutReqctx

func DelayTaskWithoutReqctx(ctx context.Context, task workmanager.DelayTaskFunc, params interface{})

func GetComputeSession

func GetComputeSession(ctx context.Context) *mcclient.ClientSession

func GetImageSession

func GetImageSession(ctx context.Context) *mcclient.ClientSession

func GetK8sSession

func GetK8sSession(ctx context.Context) *mcclient.ClientSession

func GetWireInfo

func GetWireInfo(ctx context.Context, wireId string) (jsonutils.JSONObject, error)

func GetWireOfIp

func GetWireOfIp(ctx context.Context, params jsonutils.JSONObject) (jsonutils.JSONObject, error)

func GetWorkManager

func GetWorkManager() *workmanager.SWorkManager

func Init

func Init()

func InitK8sWorkerManager

func InitK8sWorkerManager()

func InitWorkerManager

func InitWorkerManager()

func InitWorkerManagerWithCount

func InitWorkerManagerWithCount(count int)

func K8sTaskComplete

func K8sTaskComplete(ctx context.Context, params jsonutils.JSONObject)

func K8sTaskFailed

func K8sTaskFailed(ctx context.Context, reason string)

func RemoteStoragecacheCacheImage

func RemoteStoragecacheCacheImage(ctx context.Context, storagecacheId, imageId, status, spath string) (jsonutils.JSONObject, error)

func Response

func Response(ctx context.Context, w http.ResponseWriter, res interface{})

func ResponseOk

func ResponseOk(ctx context.Context, w http.ResponseWriter)

func TaskComplete

func TaskComplete(ctx context.Context, params jsonutils.JSONObject)

func TaskFailed

func TaskFailed(ctx context.Context, reason string)

func TaskFailed2

func TaskFailed2(ctx context.Context, reason string, params *jsonutils.JSONDict)

func UpdateServerProgress

func UpdateServerProgress(ctx context.Context, sid string, progress, progressMbps float64) (jsonutils.JSONObject, error)

func UpdateServerStatus

func UpdateServerStatus(ctx context.Context, sid string, statusInput *apis.PerformStatusInput) (jsonutils.JSONObject, error)

Types

type IHost

type IHost interface {
	GetZoneId() string
	GetHostId() string
	GetMasterIp() string
	GetCpuArchitecture() string
	IsAarch64() bool

	IsHugepagesEnabled() bool
	HugepageSizeKb() int

	IsKvmSupport() bool
	IsNestedVirtualization() bool

	PutHostOnline() error
	StartDHCPServer()

	GetBridgeDev(bridge string) hostbridge.IBridgeDriver
	GetIsolatedDeviceManager() isolated_device.IsolatedDeviceManager

	GetKubeletConfig() kubelet.KubeletConfig
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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