route

package
v0.0.0-...-869e999 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: GPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHardware

func AddHardware(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

添加

func AddLocation

func AddLocation(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

添加

func AddManageNetwork

func AddManageNetwork(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

添加

func AddNetwork

func AddNetwork(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

添加

func AddOsConfig

func AddOsConfig(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

添加OS操作系统

func AddSystemConfig

func AddSystemConfig(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

添加

func AddTaskInfo

func AddTaskInfo(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func AddUser

func AddUser(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func AddVmDevice

func AddVmDevice(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func BatchAddDevice

func BatchAddDevice(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

添加

func BatchAssignManufacturerOnwer

func BatchAssignManufacturerOnwer(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func BatchCancelInstall

func BatchCancelInstall(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

取消安装

func BatchDelete

func BatchDelete(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func BatchDeleteScanDevice

func BatchDeleteScanDevice(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func BatchDeleteVm

func BatchDeleteVm(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func BatchPowerOff

func BatchPowerOff(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func BatchPowerOn

func BatchPowerOn(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func BatchReInstall

func BatchReInstall(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

重装

func BatchReInstallVm

func BatchReInstallVm(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

重装

func BatchReStart

func BatchReStart(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func BatchReStartVm

func BatchReStartVm(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func BatchStartFromPxe

func BatchStartFromPxe(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func BatchStartVm

func BatchStartVm(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func BatchStopVm

func BatchStopVm(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func BatchUpdateDevice

func BatchUpdateDevice(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func CheckOnlineUpdate

func CheckOnlineUpdate(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func CloudBootCron

func CloudBootCron(conf *config.Config, logger logger.Logger, repo model.Repo)

func CollectAndUpdateVmHostResource

func CollectAndUpdateVmHostResource(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func CreateNewMacAddress

func CreateNewMacAddress(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func CreatePxeFile

func CreatePxeFile(ctx context.Context, mac string) error

func DBVersionUpdate

func DBVersionUpdate(conf *config.Config, logger logger.Logger, repo model.Repo)

func DeleteHardwareById

func DeleteHardwareById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func DeleteLocationById

func DeleteLocationById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func DeleteManageNetworkById

func DeleteManageNetworkById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func DeleteNetworkById

func DeleteNetworkById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func DeleteOsConfigById

func DeleteOsConfigById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

OsConfig

func DeleteSystemConfigById

func DeleteSystemConfigById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

SystemConfig

func DeleteTaskInfoByID

func DeleteTaskInfoByID(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func DeleteUserById

func DeleteUserById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func DeleteVmDeviceById

func DeleteVmDeviceById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func ExportDevice

func ExportDevice(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func ExportHardware

func ExportHardware(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func ExportScanDeviceList

func ExportScanDeviceList(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func FormatLocationToTreeByPid

func FormatLocationToTreeByPid(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetCidrInfoByNetwork

func GetCidrInfoByNetwork(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

获取cidr信息

func GetCompanyByGroup

func GetCompanyByGroup(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetDeviceById

func GetDeviceById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetDeviceBySn

func GetDeviceBySn(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetDeviceInstallCallbackList

func GetDeviceInstallCallbackList(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetDeviceInstallReport

func GetDeviceInstallReport(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetDeviceList

func GetDeviceList(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetDeviceLogByDeviceIdAndType

func GetDeviceLogByDeviceIdAndType(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetDeviceNumByStatus

func GetDeviceNumByStatus(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetDevicePrepareInstallInfo

func GetDevicePrepareInstallInfo(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

查询安装信息

func GetDhcpSubnetList

func GetDhcpSubnetList(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetFullDeviceById

func GetFullDeviceById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetFullVmDeviceById

func GetFullVmDeviceById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetHardwareById

func GetHardwareById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetHardwareBySn

func GetHardwareBySn(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetHardwareList

func GetHardwareList(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetLocationById

func GetLocationById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetLocationList

func GetLocationList(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetLocationListByPid

func GetLocationListByPid(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetLocationTreeNameById

func GetLocationTreeNameById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetManageNetworkById

func GetManageNetworkById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetManageNetworkList

func GetManageNetworkList(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetModelNameByWhereAndGroup

func GetModelNameByWhereAndGroup(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetNetworkById

func GetNetworkById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetNetworkBySn

func GetNetworkBySn(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetNetworkBySnForVm

func GetNetworkBySnForVm(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetNetworkList

func GetNetworkList(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetNotUsedIPListByNetworkId

func GetNotUsedIPListByNetworkId(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetOsConfigById

func GetOsConfigById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetOsConfigList

func GetOsConfigList(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetPlatformConfigByName

func GetPlatformConfigByName(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetProductByWhereAndGroup

func GetProductByWhereAndGroup(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetScanDeviceByDeviceId

func GetScanDeviceByDeviceId(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetScanDeviceById

func GetScanDeviceById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetScanDeviceCompany

func GetScanDeviceCompany(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetScanDeviceList

func GetScanDeviceList(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetScanDeviceModelName

func GetScanDeviceModelName(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetScanDeviceProduct

func GetScanDeviceProduct(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetSystemBySn

func GetSystemBySn(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetSystemBySnForVm

func GetSystemBySnForVm(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetSystemConfigById

func GetSystemConfigById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetSystemConfigList

func GetSystemConfigList(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetTaskInfoPage

func GetTaskInfoPage(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetTaskResultPage

func GetTaskResultPage(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetUserById

func GetUserById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetUserList

func GetUserList(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetVmDeviceById

func GetVmDeviceById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetVmDeviceList

func GetVmDeviceList(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetVmDeviceListByHostSn

func GetVmDeviceListByHostSn(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetVmDeviceLogByDeviceIdAndType

func GetVmDeviceLogByDeviceIdAndType(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetVmHostBySn

func GetVmHostBySn(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func GetVmHostList

func GetVmHostList(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func ImportDevice

func ImportDevice(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func ImportDeviceForOpenApi

func ImportDeviceForOpenApi(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func ImportPriview

func ImportPriview(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func InitBootOSIPForScanDeviceListProcess

func InitBootOSIPForScanDeviceListProcess(logger logger.Logger, repo model.Repo)

func InstallTimeoutProcess

func InstallTimeoutProcess(conf *config.Config, logger logger.Logger, repo model.Repo)

func IsInPreInstallList

func IsInPreInstallList(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func IsInPreInstallListForVm

func IsInPreInstallListForVm(ctx context.Context, w rest.ResponseWriter, mac string)

func Login

func Login(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func LoginOut

func LoginOut(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func ReceiveCallback

func ReceiveCallback(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func ReportDeviceInstallReport

func ReportDeviceInstallReport(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func ReportInstallInfo

func ReportInstallInfo(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

上报安装进度

func ReportInstallInfoForVm

func ReportInstallInfoForVm(ctx context.Context, w rest.ResponseWriter, mac string, title string, installProgress float64, log string)

func ReportMacInfo

func ReportMacInfo(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

上报Mac信息,生成Pxe文件

func ReportProductInfo

func ReportProductInfo(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

上报厂商信息

func RunCreateVm

func RunCreateVm(ctx context.Context, vmDeviceId uint) error

func RunCreateVmNoVncTokenFile

func RunCreateVmNoVncTokenFile(repo model.Repo, logger logger.Logger, vmDeviceId uint) error

create noVNC token file

func RunCreateVol

func RunCreateVol(ctx context.Context, vmDeviceId uint) error

func RunDeleteVmNoVncTokenFile

func RunDeleteVmNoVncTokenFile(repo model.Repo, logger logger.Logger, vmDeviceId uint) error

delete noVNC token file

func RunDestroyVm

func RunDestroyVm(ctx context.Context, vmDeviceId uint) error

func RunDestroyVol

func RunDestroyVol(ctx context.Context, vmDeviceId uint) error

func RunGetVmHostInfo

func RunGetVmHostInfo(repo model.Repo, logger logger.Logger, deviceId uint) (string, error)

get vm host info

func RunGetVmHostPoolInfo

func RunGetVmHostPoolInfo(repo model.Repo, logger logger.Logger, conf *config.Config, deviceId uint) (string, error)

get vm pool info

func RunGetVmInfo

func RunGetVmInfo(repo model.Repo, logger logger.Logger, vmDeviceId uint) (string, error)

get vm info

func RunOnlineUpdate

func RunOnlineUpdate(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func RunReStartVm

func RunReStartVm(ctx context.Context, vmDeviceId uint) error

restart vm

func RunStartVm

func RunStartVm(ctx context.Context, vmDeviceId uint) error

start vm

func RunStopVm

func RunStopVm(ctx context.Context, vmDeviceId uint) error

stop vm

func RunTestConnectVmHost

func RunTestConnectVmHost(repo model.Repo, logger logger.Logger, deviceId uint) (string, error)

test connect vm host

func SaveDeviceInstallCallback

func SaveDeviceInstallCallback(ctx context.Context, deviceId uint, callbackType string, content string) error

func SaveDhcpSubnet

func SaveDhcpSubnet(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func SavePlatformConfig

func SavePlatformConfig(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func UpdateHardwareById

func UpdateHardwareById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func UpdateLocationById

func UpdateLocationById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func UpdateManageNetworkById

func UpdateManageNetworkById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func UpdateMyInfo

func UpdateMyInfo(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func UpdateNetworkById

func UpdateNetworkById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func UpdateOsConfigById

func UpdateOsConfigById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func UpdateSystemConfigById

func UpdateSystemConfigById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func UpdateUserById

func UpdateUserById(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func UpdateVmHostResource

func UpdateVmHostResource(logger logger.Logger, repo model.Repo, conf *config.Config, deviceId uint)

func UploadCompanyHardware

func UploadCompanyHardware(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func UploadDevice

func UploadDevice(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func UploadFile

func UploadFile(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func UploadHardware

func UploadHardware(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func UploadScript

func UploadScript(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func ValidateIp

func ValidateIp(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func ValidateMac

func ValidateMac(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func ValidateManageIp

func ValidateManageIp(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func ValidateSn

func ValidateSn(ctx context.Context, w rest.ResponseWriter, r *rest.Request)

func VerifyAccessPurview

func VerifyAccessPurview(token string, ctx context.Context, isVerifyAdministratorRole bool, w rest.ResponseWriter, r *rest.Request) (model.UserWithToken, error)

func VerifyAccessToken

func VerifyAccessToken(token string, ctx context.Context, isVerifyAdministratorRole bool) (model.UserWithToken, error)

Types

type BatchOperateInfo

type BatchOperateInfo struct {
	Sn          string
	AccessToken string
	UserID      uint
	OobIp       string
	Username    string
	Password    string
}

func CheckPermissionForBatchOperate

func CheckPermissionForBatchOperate(ctx context.Context, w rest.ResponseWriter, r *rest.Request, infos []BatchOperateInfo) (bool, []BatchOperateInfo)

type Extend

type Extend struct {
	SrcFile     string `json:"SrcFile"`
	DestFile    string `json:"DestFile"`
	Script      string `json:"Script"`
	ScriptType  string `json:"ScriptType"`
	ScriptParam string `json:"ScriptParam"`
}

type TaskInfoPageReq

type TaskInfoPageReq struct {
	ID          uint   `json:"id"`
	TaskNo      string `json:"TaskNo"`
	AccessToken string `json:"AccessToken"`
	Keyword     string `json:"keyword"`
	Limit       uint
	Offset      uint
}

type TaskInfoReq

type TaskInfoReq struct {
	TaskName    string   `json:"TaskName"`
	TaskType    string   `json:"TaskType"`    //file or  script
	TaskChannel string   `json:"TaskChannel"` //ssh or salt
	RunAs       string   `json:"RunAs"`
	Timeout     uint     `json:"Timeout"`
	Extend      Extend   `json:"Extend"`
	SNs         []string `json:"SNs"`
	Password    string   `json:"Password"`
	AccessToken string   `json:"AccessToken"`
}

type TaskResultPageReq

type TaskResultPageReq struct {
	TaskID      uint   `json:"TaskID"`
	TaskNo      string `json:"TaskNo"`
	AccessToken string `json:"AccessToken"`
	Limit       uint
	Offset      uint
}

Jump to

Keyboard shortcuts

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