hostHandler

package
v0.0.0-...-5746ace Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DownloadCtrl

type DownloadCtrl struct {
	TaskService *hostAgentService.TaskService `inject:""`

	DownloadService *hostAgentService.DownloadService `inject:""`
}

func NewDownloadCtrl

func NewDownloadCtrl() *DownloadCtrl

func (*DownloadCtrl) Add

func (c *DownloadCtrl) Add(ctx iris.Context)

@summary 添加下载任务 @Accept json @Produce json @Param DownloadReq body []v1.DownloadReq true "Download Request Object" @Success 200 {object} _domain.Response "code = success | fail" @Router /api/v1/download/add [post]

func (*DownloadCtrl) Cancel

func (c *DownloadCtrl) Cancel(ctx iris.Context)

@summary 强制终止下载任务 @Accept json @Produce json @Param DownloadCancelReq body v1.DownloadCancelReq true "CancelDate Download Request Object" @Success 200 {object} _domain.Response "code = success | fail" @Router /api/v1/download/cancel [post]

type KvmCtrl

type KvmCtrl struct {
	KvmService     *kvmService.KvmService        `inject:""`
	SnapService    *hostAgentService.SnapService `inject:""`
	LibvirtService *kvmService.LibvirtService    `inject:""`
}

func NewKvmCtrl

func NewKvmCtrl() *KvmCtrl

func (*KvmCtrl) Boot

func (c *KvmCtrl) Boot(ctx iris.Context)

Boot @summary 启动KVM虚拟机 @Accept json @Produce json @Param name path string true "Kvm Name" @Success 200 {object} _domain.Response{data=string} "code = success | fail" @Router /api/v1/kvm/{name}/boot [post]

func (*KvmCtrl) Create

func (c *KvmCtrl) Create(ctx iris.Context)

Create @summary 创建KVM虚拟机 @Accept json @Produce json @Param CreateVmReq body v1.CreateVmReq true "Create Kvm Request Object" @Success 200 {object} _domain.Response{data=v1.CreateVmResp} "code = success | fail" @Router /api/v1/kvm/create [post]

func (*KvmCtrl) Destroy

func (c *KvmCtrl) Destroy(ctx iris.Context)

Destroy @summary 安全关闭并断电KVM虚拟机,关机不成功的情况下放弃 @Accept json @Produce json @Param name path string true "Kvm Name" @Success 200 {object} _domain.Response{data=string} "code = success | fail" @Router /api/v1/kvm/{name}/destroy [post]

func (*KvmCtrl) ExportVm

func (c *KvmCtrl) ExportVm(ctx iris.Context)

ExportVm @summary 导出KVM虚拟机为模板镜像 @Accept json @Produce json @Param ExportVmReq body v1.ExportVmReq true "Export Kvm Request Object" @Success 200 {object} _domain.Response "code = success | fail" @Router /api/v1/kvm/exportVm [post]

func (*KvmCtrl) Poweroff

func (c *KvmCtrl) Poweroff(ctx iris.Context)

Poweroff @summary 强行关闭并断电KVM虚拟机,关闭超时情况下会强行断电 @Accept json @Produce json @Param name path string true "Kvm Name" @Success 200 {object} _domain.Response{data=string} "code = success | fail" @Router /api/v1/kvm/{name}/poweroff [post]

func (*KvmCtrl) Reboot

func (c *KvmCtrl) Reboot(ctx iris.Context)

Reboot @summary 向KVM虚拟机发送重启信号,有可能无法成功重启 @Accept json @Produce json @Param name path string true "Kvm Name" @Success 200 {object} _domain.Response{data=string} "code = success | fail" @Router /api/v1/kvm/{name}/reboot [post]

func (*KvmCtrl) Remove

func (c *KvmCtrl) Remove(ctx iris.Context)

Resume @summary 移除KVM虚拟机 @Accept json @Produce json @Param name path string true "Kvm Name" @Param removeDisk query bool false "remove vm disk file or not" @Success 200 {object} _domain.Response{data=string} "code = success | fail" @Router /api/v1/kvm/{name}/remove [post]

func (*KvmCtrl) Resume

func (c *KvmCtrl) Resume(ctx iris.Context)

Resume @summary 恢复KVM虚拟机 @Accept json @Produce json @Param name path string true "Kvm Name" @Success 200 {object} _domain.Response{data=string} "code = success | fail" @Router /api/v1/kvm/{name}/resume [post]

func (*KvmCtrl) Shutdown

func (c *KvmCtrl) Shutdown(ctx iris.Context)

Shutdown @summary 向KVM虚拟机发送关闭信号,有可能无法成功关闭 @Accept json @Produce json @Param name path string true "Kvm Name" @Success 200 {object} _domain.Response{data=string} "code = success | fail" @Router /api/v1/kvm/{name}/shutdown [post]

func (*KvmCtrl) Suspend

func (c *KvmCtrl) Suspend(ctx iris.Context)

Suspend @summary 休眠KVM虚拟机 @Accept json @Produce json @Param name path string true "Kvm Name" @Success 200 {object} _domain.Response{data=string} "code = success | fail" @Router /api/v1/kvm/{name}/suspend [post]

type MultiPassCtrl

type MultiPassCtrl struct {
	MultiPassService *multiPassService.MultiPassService `inject:""`
}

func NewMultiPassCtrl

func NewMultiPassCtrl() *MultiPassCtrl

func (*MultiPassCtrl) Create

func (c *MultiPassCtrl) Create(ctx iris.Context)

func (*MultiPassCtrl) Destroy

func (c *MultiPassCtrl) Destroy(ctx iris.Context)

func (*MultiPassCtrl) GetToken

func (c *MultiPassCtrl) GetToken(ctx iris.Context)

func (*MultiPassCtrl) List

func (c *MultiPassCtrl) List(ctx iris.Context)

func (*MultiPassCtrl) Reboot

func (c *MultiPassCtrl) Reboot(ctx iris.Context)

func (*MultiPassCtrl) Resume

func (c *MultiPassCtrl) Resume(ctx iris.Context)

func (*MultiPassCtrl) Suspend

func (c *MultiPassCtrl) Suspend(ctx iris.Context)

type ServiceCtrl

type ServiceCtrl struct {
	StatusService *hostStatusService.StatusService `inject:""`
}

func NewCheckCtrl

func NewCheckCtrl() *ServiceCtrl

func (*ServiceCtrl) CheckService

func (c *ServiceCtrl) CheckService(ctx iris.Context)

@summary 检测宿主机服务状态 @Accept json @Produce json @Param HostServiceCheckReq body v1.HostServiceCheckReq true "Service Check Request Object" @Success 200 {object} v1.HostServiceCheckResp "code = success | fail" @Router /api/v1/service/check [post]

type SnapCtrl

type SnapCtrl struct {
	TaskService *hostAgentService.TaskService `inject:""`

	SnapService *hostAgentService.SnapService `inject:""`
}

func NewSnapCtrl

func NewSnapCtrl() *SnapCtrl

func (*SnapCtrl) AddCreateSnap

func (c *SnapCtrl) AddCreateSnap(ctx iris.Context)

@summary 添加创建快照任务 @Accept json @Produce json @Param SnapTaskReq body []v1.SnapTaskReq true "Snap Request Object" @Success 200 {object} _domain.Response "code = success | fail" @Router /api/v1/snaps/addCreateSnap [post]

func (*SnapCtrl) AddRevertSnap

func (c *SnapCtrl) AddRevertSnap(ctx iris.Context)

@summary 添加回滚到快照任务 @Accept json @Produce json @Param SnapTaskReq body []v1.SnapTaskReq true "Snap Request Object" @Success 200 {object} _domain.Response "code = success | fail" @Router /api/v1/snaps/addRevertSnap [post]

func (*SnapCtrl) ListSnap

func (c *SnapCtrl) ListSnap(ctx iris.Context)

@summary 列出虚拟机快照任务 @Accept json @Produce json @Param vm query string true "vm name" @Success 200 {object} _domain.Response "code = success | fail" @Router /api/v1/snaps/listSnap [get]

func (*SnapCtrl) RemoveSnap

func (c *SnapCtrl) RemoveSnap(ctx iris.Context)

@summary 移除虚拟机快照任务 @Accept json @Produce json @Param SnapTaskReq body []v1.SnapTaskReq true "Snap Request Object" @Success 200 {object} _domain.Response "code = success | fail" @Router /api/v1/snaps/removeSnap [post]

type TaskCtrl

type TaskCtrl struct {
	TaskService *hostAgentService.TaskService `inject:""`
}

func NewTaskCtrl

func NewTaskCtrl() *TaskCtrl

func (*TaskCtrl) GetStatus

func (c *TaskCtrl) GetStatus(ctx iris.Context)

@summary 获取任务状态 @Accept json @Produce json @Success 200 {object} _domain.Response{data=v1.ListTaskResp} "code = success | fail" @Router /api/v1/task/status [get]

type TestCtrl

type TestCtrl struct {
}

func NewTestCtrl

func NewTestCtrl() *TestCtrl

func (*TestCtrl) Test

func (c *TestCtrl) Test(ctx iris.Context)

type VirtualBoxCtrl

type VirtualBoxCtrl struct {
	VirtualBoxService *virtualboxService.VirtualBoxService `inject:""`
}

func NewVirtualBoxCtrl

func NewVirtualBoxCtrl() *VirtualBoxCtrl

func (*VirtualBoxCtrl) Create

func (c *VirtualBoxCtrl) Create(ctx iris.Context)

func (*VirtualBoxCtrl) Destroy

func (c *VirtualBoxCtrl) Destroy(ctx iris.Context)

func (*VirtualBoxCtrl) ListTmpl

func (c *VirtualBoxCtrl) ListTmpl(ctx iris.Context)

type VirtualCtrl

type VirtualCtrl struct {
	NatService   *virtualService.NatService   `inject:""`
	NoVncService *virtualService.NoVncService `inject:""`
	KvmService   *kvmService.KvmService       `inject:""`
}

func NewVirtualCtrl

func NewVirtualCtrl() *VirtualCtrl

func (*VirtualCtrl) AddVmPortMap

func (c *VirtualCtrl) AddVmPortMap(ctx iris.Context)

@summary 新增虚拟机到宿主机端口的映射 @Accept json @Produce json @Param VmPortMapReq body v1.VmPortMapReq true "Vm Port Map Request Object" @Success 200 {object} _domain.Response{data=v1.VmPortMapResp} "code = success | fail" @Router /api/v1/virtual/addVmPortMap [post]

func (*VirtualCtrl) GetAddress

func (c *VirtualCtrl) GetAddress(ctx iris.Context)

@summary 根据VNC Token 获取 ip,port @Accept json @Produce json @Param port query string true "VNC Port" @Success 200 {object} _domain.Response{v1.VncTokenResp} "code = success | fail" @Router /api/v1/virtual/getVncAddress [get]

func (*VirtualCtrl) GetToken

func (c *VirtualCtrl) GetToken(ctx iris.Context)

@summary 根据VNC Port获取Token @Accept json @Produce json @Param port query string true "VNC Port" @Success 200 {object} _domain.Response{data=v1.VncTokenResp} "code = success | fail" @Router /api/v1/virtual/getVncToken [get]

func (*VirtualCtrl) RemoveVmPortMap

func (c *VirtualCtrl) RemoveVmPortMap(ctx iris.Context)

@summary 移除虚拟机到宿主机的端口映射 @Accept json @Produce json @Param VmPortMapReq body v1.VmPortMapReq true "Vm Port Map Request Object" @Success 200 {object} _domain.Response "code = success | fail" @Router /api/v1/virtual/removeVmPortMap [post]

func (*VirtualCtrl) VmHeartbeat

func (c *VirtualCtrl) VmHeartbeat(ctx iris.Context)

@summary 虚拟机心跳并请求Token @Accept json @Produce json @Param VmNotifyReq body v1.VmNotifyReq true "Vm Notify Request Object" @Success 200 {object} _domain.Response{data=v1.VmNotifyResp} "code = success | fail" @Router /api/v1/virtual/notifyHost [post]

type VmWareCtrl

type VmWareCtrl struct {
	VmWareService *vmWareService.VmWareService `inject:""`
}

func NewVmWareCtrl

func NewVmWareCtrl() *VmWareCtrl

func (*VmWareCtrl) Create

func (c *VmWareCtrl) Create(ctx iris.Context)

func (*VmWareCtrl) Destroy

func (c *VmWareCtrl) Destroy(ctx iris.Context)

Jump to

Keyboard shortcuts

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