mysqlrepo

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ViewAction 查看操作
	ViewAction Action = "view"
	// ExecAction 执行命令操作
	ExecAction Action = "exec"
	// UpdateAction 更新操作
	UpdateAction Action = "update"
	// InsertAction 新增操作
	InsertAction Action = "insert"
	// DeleteAction 删除操作
	DeleteAction Action = "delete"

	// DataCenter 权限资源类型-数据中心
	DataCenter ResourceType = "dataCenter"
	// AppRes 权限资源类型-应用
	AppRes ResourceType = "app"
	// UnitRes 权限资源类型-部署单元
	UnitRes ResourceType = "unit"
	// NodeRes 权限资源类型-主机节点
	NodeRes ResourceType = "node"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string

Action 操作

type MySQLRepo

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

MySQLRepo mysql数据库实现

func NewRepo

func NewRepo(conf *config.Config, log logger.Logger) (*MySQLRepo, error)

NewRepo 创建mysql数据实现实例

func (*MySQLRepo) AddDevice

func (repo *MySQLRepo) AddDevice(batchNumber string, sn string, hostname string, ip string, manageIp string, networkId uint, manageNetworkId uint, osId uint, hardwareId uint, systemId uint, location string, locationId uint, assetNumber string, status string, isSupportVm string, userID uint) (*model.Device, error)

device相关

func (*MySQLRepo) AddDeviceInstallCallback

func (repo *MySQLRepo) AddDeviceInstallCallback(DeviceID uint, CallbackType string, Content string, RunTime string, RunResult string, RunStatus string) (*model.DeviceInstallCallback, error)

DeviceLog相关

func (*MySQLRepo) AddDeviceLog

func (repo *MySQLRepo) AddDeviceLog(deviceID uint, title string, logType string, content string) (*model.DeviceLog, error)

DeviceLog相关

func (*MySQLRepo) AddDhcpSubnet

func (repo *MySQLRepo) AddDhcpSubnet(startIp string, endIp string, gateway string) (*model.DhcpSubnet, error)

func (*MySQLRepo) AddHardware

func (repo *MySQLRepo) AddHardware(company string, product string, modelName string, raid string, oob string, bios string, isSystemAdd string, tpl string, data string, source string, version string, status string) (*model.Hardware, error)

Hardware

func (*MySQLRepo) AddIp

func (repo *MySQLRepo) AddIp(networkId uint, ip string) (*model.Ip, error)

func (*MySQLRepo) AddLocation

func (repo *MySQLRepo) AddLocation(pid uint, name string) (*model.Location, error)

func (*MySQLRepo) AddMac

func (repo *MySQLRepo) AddMac(deviceId uint, mac string) (*model.Mac, error)

func (*MySQLRepo) AddManageIp

func (repo *MySQLRepo) AddManageIp(networkId uint, ip string) (*model.ManageIp, error)

func (*MySQLRepo) AddManageNetwork

func (repo *MySQLRepo) AddManageNetwork(network string, netmask string, gateway string, vlan string, trunk string, bonding string) (*model.ManageNetwork, error)

SystemConfig相关

func (*MySQLRepo) AddManufacturer

func (repo *MySQLRepo) AddManufacturer(deviceId uint, company string, product string, modelName string, sn string, ip string, mac string, nic string, cpu string, cpuSum uint, memory string, memorySum uint, disk string, diskSum uint, motherboard string, raid string, oob string, isVm string, nicDevice string, isShowInScanList string) (*model.Manufacturer, error)

func (*MySQLRepo) AddNetwork

func (repo *MySQLRepo) AddNetwork(network string, netmask string, gateway string, vlan string, trunk string, bonding string) (*model.Network, error)

SystemConfig相关

func (*MySQLRepo) AddOsConfig

func (repo *MySQLRepo) AddOsConfig(name string, pxe string) (*model.OsConfig, error)

func (*MySQLRepo) AddPlatformConfig

func (repo *MySQLRepo) AddPlatformConfig(name string, content string) (*model.PlatformConfig, error)

func (*MySQLRepo) AddSystemConfig

func (repo *MySQLRepo) AddSystemConfig(name string, content string) (*model.SystemConfig, error)

SystemConfig相关

func (*MySQLRepo) AddUser

func (repo *MySQLRepo) AddUser(username string, password string, name string, phoneNumber string, permission string, status string, role string) (*model.User, error)

func (*MySQLRepo) AddUserAccessToken

func (repo *MySQLRepo) AddUserAccessToken(userId uint, accessToken string) (*model.UserAccessToken, error)

func (*MySQLRepo) AddVmDevice

func (repo *MySQLRepo) AddVmDevice(
	DeviceID uint,
	Hostname string,
	Mac string,
	Ip string,
	NetworkID uint,
	OsID uint,
	SystemID uint,
	CpuCoresNumber uint,
	CpuHotPlug string,
	CpuPassthrough string,
	CpuTopSockets uint,
	CpuTopCores uint,
	CpuTopThreads uint,
	CpuPinning string,
	MemoryCurrent uint,
	MemoryMax uint,
	MemoryKsm string,
	DiskType string,
	DiskSize uint,
	DiskBusType string,
	DiskCacheMode string,
	DiskIoMode string,
	NetworkType string,
	NetworkDeviceType string,
	DisplayType string,
	DisplayPassword string,
	DisplayUpdatePassword string,
	Status string,
	UserID uint,
	VncPort string,
	RunStatus string) (model.VmDevice, error)

func (*MySQLRepo) AddVmDeviceLog

func (repo *MySQLRepo) AddVmDeviceLog(deviceID uint, title string, logType string, content string) (*model.VmDeviceLog, error)

DeviceLog相关

func (*MySQLRepo) AddVmHost

func (repo *MySQLRepo) AddVmHost(sn string, cpuSum uint, cpuUsed uint, cpuAvailable uint, memorySum uint, memoryUsed uint, memoryAvailable uint, diskSum uint, diskUsed uint, diskAvailable uint, isAvailable string, remark string, vmNum uint) (*model.VmHost, error)

func (*MySQLRepo) AssignManufacturerNewOnwer

func (repo *MySQLRepo) AssignManufacturerNewOnwer(newOwnerID uint, oldOwnerID uint) error

func (*MySQLRepo) AssignManufacturerOnwer

func (repo *MySQLRepo) AssignManufacturerOnwer(id uint, userId uint) (*model.Manufacturer, error)

func (*MySQLRepo) AssignNewIpByNetworkId

func (repo *MySQLRepo) AssignNewIpByNetworkId(network_id uint) (string, error)

func (*MySQLRepo) CancelInstallDeviceById

func (repo *MySQLRepo) CancelInstallDeviceById(id uint) (*model.Device, error)

func (*MySQLRepo) Close

func (repo *MySQLRepo) Close() error

Close 关闭mysql连接

func (*MySQLRepo) CopyDeviceToHistory

func (repo *MySQLRepo) CopyDeviceToHistory(id uint) error

func (*MySQLRepo) CopyDeviceToInstallReport

func (repo *MySQLRepo) CopyDeviceToInstallReport(id uint) error

func (*MySQLRepo) CopyVmDeviceToInstallReport

func (repo *MySQLRepo) CopyVmDeviceToInstallReport(id uint) error

func (*MySQLRepo) CountDevice

func (repo *MySQLRepo) CountDevice(where string) (int, error)

func (*MySQLRepo) CountDeviceByHostname

func (repo *MySQLRepo) CountDeviceByHostname(hostname string) (uint, error)

func (*MySQLRepo) CountDeviceByHostnameAndId

func (repo *MySQLRepo) CountDeviceByHostnameAndId(hostname string, id uint) (uint, error)

func (*MySQLRepo) CountDeviceByIp

func (repo *MySQLRepo) CountDeviceByIp(ip string) (uint, error)

func (*MySQLRepo) CountDeviceByIpAndId

func (repo *MySQLRepo) CountDeviceByIpAndId(ip string, id uint) (uint, error)

func (*MySQLRepo) CountDeviceByManageIp

func (repo *MySQLRepo) CountDeviceByManageIp(manageIp string) (uint, error)

func (*MySQLRepo) CountDeviceByManageIpAndId

func (repo *MySQLRepo) CountDeviceByManageIpAndId(manageIp string, id uint) (uint, error)

func (*MySQLRepo) CountDeviceBySn

func (repo *MySQLRepo) CountDeviceBySn(sn string) (uint, error)

func (*MySQLRepo) CountDeviceByWhere

func (repo *MySQLRepo) CountDeviceByWhere(where string) (int, error)

func (*MySQLRepo) CountDeviceInstallCallbackByDeviceIDAndType

func (repo *MySQLRepo) CountDeviceInstallCallbackByDeviceIDAndType(deviceID uint, callbackType string) (uint, error)

func (*MySQLRepo) CountDeviceInstallReportByWhere

func (repo *MySQLRepo) CountDeviceInstallReportByWhere(where string) (uint, error)

func (*MySQLRepo) CountDeviceLog

func (repo *MySQLRepo) CountDeviceLog() (uint, error)

func (*MySQLRepo) CountDeviceLogByDeviceID

func (repo *MySQLRepo) CountDeviceLogByDeviceID(deviceID uint) (uint, error)

func (*MySQLRepo) CountDeviceLogByDeviceIDAndType

func (repo *MySQLRepo) CountDeviceLogByDeviceIDAndType(deviceID uint, logType string) (uint, error)

func (*MySQLRepo) CountDhcpSubnet

func (repo *MySQLRepo) CountDhcpSubnet() (uint, error)

func (*MySQLRepo) CountHardware

func (repo *MySQLRepo) CountHardware(where string) (uint, error)

func (*MySQLRepo) CountHardwareByCompanyAndProductAndName

func (repo *MySQLRepo) CountHardwareByCompanyAndProductAndName(company string, product string, modelName string) (uint, error)

func (*MySQLRepo) CountHardwareByCompanyAndProductAndNameAndId

func (repo *MySQLRepo) CountHardwareByCompanyAndProductAndNameAndId(company string, product string, modelName string, id uint) (uint, error)

func (*MySQLRepo) CountHardwareByWhere

func (repo *MySQLRepo) CountHardwareByWhere(where string) (uint, error)

func (*MySQLRepo) CountHardwareWithSeparator

func (repo *MySQLRepo) CountHardwareWithSeparator(name string) (uint, error)

func (*MySQLRepo) CountIpByIp

func (repo *MySQLRepo) CountIpByIp(ip string) (uint, error)

func (*MySQLRepo) CountLocation

func (repo *MySQLRepo) CountLocation() (uint, error)

func (*MySQLRepo) CountLocationByName

func (repo *MySQLRepo) CountLocationByName(name string) (uint, error)

func (*MySQLRepo) CountLocationByNameAndPid

func (repo *MySQLRepo) CountLocationByNameAndPid(name string, pid uint) (uint, error)

func (*MySQLRepo) CountLocationByNameAndPidAndId

func (repo *MySQLRepo) CountLocationByNameAndPidAndId(name string, pid uint, id uint) (uint, error)

func (*MySQLRepo) CountLocationByPid

func (repo *MySQLRepo) CountLocationByPid(pid uint) (uint, error)

func (*MySQLRepo) CountMacByMac

func (repo *MySQLRepo) CountMacByMac(mac string) (uint, error)

func (*MySQLRepo) CountMacByMacAndDeviceID

func (repo *MySQLRepo) CountMacByMacAndDeviceID(mac string, deviceId uint) (uint, error)

func (*MySQLRepo) CountManageIpByIp

func (repo *MySQLRepo) CountManageIpByIp(ip string) (uint, error)

func (*MySQLRepo) CountManageNetwork

func (repo *MySQLRepo) CountManageNetwork() (uint, error)

func (*MySQLRepo) CountManageNetworkByNetwork

func (repo *MySQLRepo) CountManageNetworkByNetwork(network string) (uint, error)

func (*MySQLRepo) CountManageNetworkByNetworkAndId

func (repo *MySQLRepo) CountManageNetworkByNetworkAndId(network string, id uint) (uint, error)

func (*MySQLRepo) CountManufacturerByDeviceID

func (repo *MySQLRepo) CountManufacturerByDeviceID(deviceId uint) (uint, error)

func (*MySQLRepo) CountManufacturerBySn

func (repo *MySQLRepo) CountManufacturerBySn(sn string) (uint, error)

func (*MySQLRepo) CountManufacturerByWhere

func (repo *MySQLRepo) CountManufacturerByWhere(where string) (int, error)

func (*MySQLRepo) CountNetwork

func (repo *MySQLRepo) CountNetwork() (uint, error)

func (*MySQLRepo) CountNetworkByNetwork

func (repo *MySQLRepo) CountNetworkByNetwork(network string) (uint, error)

func (*MySQLRepo) CountNetworkByNetworkAndId

func (repo *MySQLRepo) CountNetworkByNetworkAndId(network string, id uint) (uint, error)

func (*MySQLRepo) CountOsConfig

func (repo *MySQLRepo) CountOsConfig() (uint, error)

func (*MySQLRepo) CountOsConfigByName

func (repo *MySQLRepo) CountOsConfigByName(name string) (uint, error)

func (*MySQLRepo) CountOsConfigByNameAndId

func (repo *MySQLRepo) CountOsConfigByNameAndId(name string, id uint) (uint, error)

func (*MySQLRepo) CountPlatformConfig

func (repo *MySQLRepo) CountPlatformConfig() (uint, error)

func (*MySQLRepo) CountPlatformConfigByName

func (repo *MySQLRepo) CountPlatformConfigByName(name string) (uint, error)

func (*MySQLRepo) CountPlatformConfigByNameAndId

func (repo *MySQLRepo) CountPlatformConfigByNameAndId(name string, id uint) (uint, error)

func (*MySQLRepo) CountSystemConfig

func (repo *MySQLRepo) CountSystemConfig() (uint, error)

func (*MySQLRepo) CountSystemConfigByName

func (repo *MySQLRepo) CountSystemConfigByName(name string) (uint, error)

func (*MySQLRepo) CountSystemConfigByNameAndId

func (repo *MySQLRepo) CountSystemConfigByNameAndId(name string, id uint) (uint, error)

func (*MySQLRepo) CountUser

func (repo *MySQLRepo) CountUser(where string) (uint, error)

func (*MySQLRepo) CountUserAccessTokenByToken

func (repo *MySQLRepo) CountUserAccessTokenByToken(accessToken string) (uint, error)

func (*MySQLRepo) CountUserById

func (repo *MySQLRepo) CountUserById(id uint) (uint, error)

func (*MySQLRepo) CountUserByUsername

func (repo *MySQLRepo) CountUserByUsername(username string) (uint, error)

func (*MySQLRepo) CountUserByWhere

func (repo *MySQLRepo) CountUserByWhere(where string) (uint, error)

func (*MySQLRepo) CountVmDevice

func (repo *MySQLRepo) CountVmDevice(where string) (int, error)

func (*MySQLRepo) CountVmDeviceByDeviceId

func (repo *MySQLRepo) CountVmDeviceByDeviceId(deviceId uint) (uint, error)

func (*MySQLRepo) CountVmDeviceByHostname

func (repo *MySQLRepo) CountVmDeviceByHostname(hostname string) (uint, error)

func (*MySQLRepo) CountVmDeviceByHostnameAndId

func (repo *MySQLRepo) CountVmDeviceByHostnameAndId(hostname string, id uint) (uint, error)

func (*MySQLRepo) CountVmDeviceByIp

func (repo *MySQLRepo) CountVmDeviceByIp(ip string) (uint, error)

func (*MySQLRepo) CountVmDeviceByIpAndId

func (repo *MySQLRepo) CountVmDeviceByIpAndId(ip string, id uint) (uint, error)

func (*MySQLRepo) CountVmDeviceByMac

func (repo *MySQLRepo) CountVmDeviceByMac(mac string) (uint, error)

func (*MySQLRepo) CountVmDeviceByMacAndId

func (repo *MySQLRepo) CountVmDeviceByMacAndId(mac string, id uint) (uint, error)

func (*MySQLRepo) CountVmDeviceLog

func (repo *MySQLRepo) CountVmDeviceLog() (uint, error)

func (*MySQLRepo) CountVmDeviceLogByDeviceID

func (repo *MySQLRepo) CountVmDeviceLogByDeviceID(deviceID uint) (uint, error)

func (*MySQLRepo) CountVmDeviceLogByDeviceIDAndType

func (repo *MySQLRepo) CountVmDeviceLogByDeviceIDAndType(deviceID uint, logType string) (uint, error)

func (*MySQLRepo) CountVmHost

func (repo *MySQLRepo) CountVmHost(where string) (int, error)

func (*MySQLRepo) CountVmHostBySn

func (repo *MySQLRepo) CountVmHostBySn(sn string) (uint, error)

func (*MySQLRepo) CreateBatchNumber

func (repo *MySQLRepo) CreateBatchNumber() (string, error)

device相关

func (*MySQLRepo) CreateHardwareBackupTable

func (repo *MySQLRepo) CreateHardwareBackupTable(fix string) error

func (*MySQLRepo) DeleteDeviceById

func (repo *MySQLRepo) DeleteDeviceById(id uint) (*model.Device, error)

func (*MySQLRepo) DeleteDeviceInstallCallbackByDeviceID

func (repo *MySQLRepo) DeleteDeviceInstallCallbackByDeviceID(deviceID uint) (*model.DeviceInstallCallback, error)

func (*MySQLRepo) DeleteDeviceInstallCallbackByID

func (repo *MySQLRepo) DeleteDeviceInstallCallbackByID(id uint) (*model.DeviceInstallCallback, error)

func (*MySQLRepo) DeleteDeviceLogByDeviceID

func (repo *MySQLRepo) DeleteDeviceLogByDeviceID(deviceID uint) (*model.DeviceLog, error)

func (*MySQLRepo) DeleteDeviceLogByDeviceIDAndType

func (repo *MySQLRepo) DeleteDeviceLogByDeviceIDAndType(deviceID uint, logType string) (*model.DeviceLog, error)

func (*MySQLRepo) DeleteDeviceLogById

func (repo *MySQLRepo) DeleteDeviceLogById(id uint) (*model.DeviceLog, error)

func (*MySQLRepo) DeleteDhcpSubnetById

func (repo *MySQLRepo) DeleteDhcpSubnetById(id uint) (*model.DhcpSubnet, error)

func (*MySQLRepo) DeleteHardwareById

func (repo *MySQLRepo) DeleteHardwareById(id uint) (*model.Hardware, error)

func (*MySQLRepo) DeleteIpByNetworkId

func (repo *MySQLRepo) DeleteIpByNetworkId(networkId uint) (*model.Ip, error)

func (*MySQLRepo) DeleteLocationById

func (repo *MySQLRepo) DeleteLocationById(id uint) (*model.Location, error)

func (*MySQLRepo) DeleteMacByDeviceId

func (repo *MySQLRepo) DeleteMacByDeviceId(deviceId uint) (*model.Mac, error)

func (*MySQLRepo) DeleteMacById

func (repo *MySQLRepo) DeleteMacById(id uint) (*model.Mac, error)

func (*MySQLRepo) DeleteManageIpByNetworkId

func (repo *MySQLRepo) DeleteManageIpByNetworkId(networkId uint) (*model.ManageIp, error)

func (*MySQLRepo) DeleteManageNetworkById

func (repo *MySQLRepo) DeleteManageNetworkById(id uint) (*model.ManageNetwork, error)

func (*MySQLRepo) DeleteManufacturerById

func (repo *MySQLRepo) DeleteManufacturerById(id uint) (*model.Manufacturer, error)

func (*MySQLRepo) DeleteManufacturerBySn

func (repo *MySQLRepo) DeleteManufacturerBySn(sn string) (*model.Manufacturer, error)

func (*MySQLRepo) DeleteNetworkById

func (repo *MySQLRepo) DeleteNetworkById(id uint) (*model.Network, error)

func (*MySQLRepo) DeleteOsConfigById

func (repo *MySQLRepo) DeleteOsConfigById(id uint) (*model.OsConfig, error)

func (*MySQLRepo) DeletePlatformConfigById

func (repo *MySQLRepo) DeletePlatformConfigById(id uint) (*model.PlatformConfig, error)

func (*MySQLRepo) DeletePlatformConfigByName

func (repo *MySQLRepo) DeletePlatformConfigByName(name string) (*model.PlatformConfig, error)

func (*MySQLRepo) DeleteSystemConfigById

func (repo *MySQLRepo) DeleteSystemConfigById(id uint) (*model.SystemConfig, error)

func (*MySQLRepo) DeleteUserAccessTokenByToken

func (repo *MySQLRepo) DeleteUserAccessTokenByToken(accessToken string) (*model.UserAccessToken, error)

func (*MySQLRepo) DeleteUserById

func (repo *MySQLRepo) DeleteUserById(id uint) (*model.User, error)

func (*MySQLRepo) DeleteVmDeviceById

func (repo *MySQLRepo) DeleteVmDeviceById(id uint) (*model.VmDevice, error)

func (*MySQLRepo) DeleteVmDeviceLogByDeviceID

func (repo *MySQLRepo) DeleteVmDeviceLogByDeviceID(deviceID uint) (*model.VmDeviceLog, error)

func (*MySQLRepo) DeleteVmDeviceLogByDeviceIDAndType

func (repo *MySQLRepo) DeleteVmDeviceLogByDeviceIDAndType(deviceID uint, logType string) (*model.VmDeviceLog, error)

func (*MySQLRepo) DeleteVmDeviceLogById

func (repo *MySQLRepo) DeleteVmDeviceLogById(id uint) (*model.VmDeviceLog, error)

func (*MySQLRepo) DeleteVmHostById

func (repo *MySQLRepo) DeleteVmHostById(id uint) (*model.VmHost, error)

func (*MySQLRepo) DeleteVmHostBySn

func (repo *MySQLRepo) DeleteVmHostBySn(sn string) (*model.VmHost, error)

func (*MySQLRepo) DeleteVmInfoByDeviceSn

func (repo *MySQLRepo) DeleteVmInfoByDeviceSn(sn string) error

func (*MySQLRepo) DropDB

func (repo *MySQLRepo) DropDB() error

DropDB 删除表

func (*MySQLRepo) DropHardwareBackupTable

func (repo *MySQLRepo) DropHardwareBackupTable(fix string) error

func (*MySQLRepo) ExecDBVersionUpdateSql

func (repo *MySQLRepo) ExecDBVersionUpdateSql(sql string) error

func (*MySQLRepo) FormatChildLocationIdById

func (repo *MySQLRepo) FormatChildLocationIdById(id uint, content string, separator string) (string, error)

func (*MySQLRepo) FormatLocationNameById

func (repo *MySQLRepo) FormatLocationNameById(id uint, content string, separator string) (string, error)

func (*MySQLRepo) FormatLocationToTreeByPid

func (repo *MySQLRepo) FormatLocationToTreeByPid(pid uint, content []map[string]interface{}, floor uint, selectPid uint) ([]map[string]interface{}, error)

func (*MySQLRepo) GetCompanyByGroup

func (repo *MySQLRepo) GetCompanyByGroup() ([]model.Hardware, error)

func (*MySQLRepo) GetCpuUsedSum

func (repo *MySQLRepo) GetCpuUsedSum(where string) (uint, error)

func (*MySQLRepo) GetDeviceById

func (repo *MySQLRepo) GetDeviceById(id uint) (*model.Device, error)

func (*MySQLRepo) GetDeviceBySn

func (repo *MySQLRepo) GetDeviceBySn(sn string) (*model.Device, error)

func (*MySQLRepo) GetDeviceBySnAndStatus

func (repo *MySQLRepo) GetDeviceBySnAndStatus(sn string, status string) (*model.Device, error)

func (*MySQLRepo) GetDeviceByWhere

func (repo *MySQLRepo) GetDeviceByWhere(where string) ([]model.Device, error)

func (*MySQLRepo) GetDeviceCompanyNameInstallReport

func (repo *MySQLRepo) GetDeviceCompanyNameInstallReport(where string) ([]model.DeviceProductNameInstallReport, error)

func (*MySQLRepo) GetDeviceHardwareNameInstallReport

func (repo *MySQLRepo) GetDeviceHardwareNameInstallReport(where string) ([]model.DeviceHardwareNameInstallReport, error)

func (*MySQLRepo) GetDeviceIdBySn

func (repo *MySQLRepo) GetDeviceIdBySn(sn string) (uint, error)

func (*MySQLRepo) GetDeviceInstallCallbackByDeviceIDAndType

func (repo *MySQLRepo) GetDeviceInstallCallbackByDeviceIDAndType(deviceID uint, callbackType string) (*model.DeviceInstallCallback, error)

func (*MySQLRepo) GetDeviceInstallCallbackByWhere

func (repo *MySQLRepo) GetDeviceInstallCallbackByWhere(where string, order string) ([]model.DeviceInstallCallback, error)

func (*MySQLRepo) GetDeviceListWithPage

func (repo *MySQLRepo) GetDeviceListWithPage(limit uint, offset uint, where string) ([]model.DeviceFull, error)

func (*MySQLRepo) GetDeviceLogById

func (repo *MySQLRepo) GetDeviceLogById(id uint) (*model.DeviceLog, error)

func (*MySQLRepo) GetDeviceLogListByDeviceID

func (repo *MySQLRepo) GetDeviceLogListByDeviceID(deviceID uint, order string) ([]model.DeviceLog, error)

func (*MySQLRepo) GetDeviceLogListByDeviceIDAndType

func (repo *MySQLRepo) GetDeviceLogListByDeviceIDAndType(deviceID uint, logType string, order string, maxId uint) ([]model.DeviceLog, error)

func (*MySQLRepo) GetDeviceOsNameInstallReport

func (repo *MySQLRepo) GetDeviceOsNameInstallReport(where string) ([]model.DeviceOsNameInstallReport, error)

func (*MySQLRepo) GetDeviceProductNameInstallReport

func (repo *MySQLRepo) GetDeviceProductNameInstallReport(where string) ([]model.DeviceProductNameInstallReport, error)

func (*MySQLRepo) GetDeviceSystemNameInstallReport

func (repo *MySQLRepo) GetDeviceSystemNameInstallReport(where string) ([]model.DeviceSystemNameInstallReport, error)

func (*MySQLRepo) GetDhcpSubnetById

func (repo *MySQLRepo) GetDhcpSubnetById(id uint) (*model.DhcpSubnet, error)

func (*MySQLRepo) GetDhcpSubnetListWithPage

func (repo *MySQLRepo) GetDhcpSubnetListWithPage(limit uint, offset uint) ([]model.DhcpSubnet, error)

func (*MySQLRepo) GetDiskUsedSum

func (repo *MySQLRepo) GetDiskUsedSum(where string) (uint, error)

func (*MySQLRepo) GetFullDeviceById

func (repo *MySQLRepo) GetFullDeviceById(id uint) (*model.DeviceFull, error)

func (*MySQLRepo) GetFullVmDeviceById

func (repo *MySQLRepo) GetFullVmDeviceById(id uint) (*model.VmDeviceFull, error)

func (*MySQLRepo) GetHardwareById

func (repo *MySQLRepo) GetHardwareById(id uint) (*model.Hardware, error)

func (*MySQLRepo) GetHardwareBySeaprator

func (repo *MySQLRepo) GetHardwareBySeaprator(name string) (*model.Hardware, error)

func (*MySQLRepo) GetHardwareBySn

func (repo *MySQLRepo) GetHardwareBySn(sn string) (*model.Hardware, error)

func (*MySQLRepo) GetHardwareByWhere

func (repo *MySQLRepo) GetHardwareByWhere(where string) (*model.Hardware, error)

func (*MySQLRepo) GetHardwareIdByCompanyAndProductAndName

func (repo *MySQLRepo) GetHardwareIdByCompanyAndProductAndName(company string, product string, modelName string) (uint, error)

func (*MySQLRepo) GetHardwareListWithPage

func (repo *MySQLRepo) GetHardwareListWithPage(limit uint, offset uint, where string) ([]model.Hardware, error)

func (*MySQLRepo) GetInstallTimeoutDeviceList

func (repo *MySQLRepo) GetInstallTimeoutDeviceList(timeout int) ([]model.Device, error)

func (*MySQLRepo) GetIpByIp

func (repo *MySQLRepo) GetIpByIp(ip string) (*model.Ip, error)

func (*MySQLRepo) GetLastDeviceLogByDeviceID

func (repo *MySQLRepo) GetLastDeviceLogByDeviceID(deviceID uint) (model.DeviceLog, error)

func (*MySQLRepo) GetLastVmDeviceLogByDeviceID

func (repo *MySQLRepo) GetLastVmDeviceLogByDeviceID(deviceID uint) (model.VmDeviceLog, error)

func (*MySQLRepo) GetLastestVersionHardware

func (repo *MySQLRepo) GetLastestVersionHardware() (model.Hardware, error)

func (*MySQLRepo) GetLocationById

func (repo *MySQLRepo) GetLocationById(id uint) (*model.Location, error)

func (*MySQLRepo) GetLocationByNameAndPid

func (repo *MySQLRepo) GetLocationByNameAndPid(name string, pid uint) (*model.Location, error)

func (*MySQLRepo) GetLocationIdByName

func (repo *MySQLRepo) GetLocationIdByName(name string) (uint, error)

func (*MySQLRepo) GetLocationListByPidWithPage

func (repo *MySQLRepo) GetLocationListByPidWithPage(limit uint, offset uint, pid uint) ([]model.Location, error)

func (*MySQLRepo) GetLocationListWithPage

func (repo *MySQLRepo) GetLocationListWithPage(limit uint, offset uint) ([]model.Location, error)

func (*MySQLRepo) GetMacById

func (repo *MySQLRepo) GetMacById(id uint) (*model.Mac, error)

func (*MySQLRepo) GetMacListByDeviceID

func (repo *MySQLRepo) GetMacListByDeviceID(deviceId uint) ([]model.Mac, error)

func (*MySQLRepo) GetManageIpByIp

func (repo *MySQLRepo) GetManageIpByIp(ip string) (*model.ManageIp, error)

func (*MySQLRepo) GetManageNetworkById

func (repo *MySQLRepo) GetManageNetworkById(id uint) (*model.ManageNetwork, error)

func (*MySQLRepo) GetManageNetworkIdByNetwork

func (repo *MySQLRepo) GetManageNetworkIdByNetwork(network string) (uint, error)

func (*MySQLRepo) GetManageNetworkListWithPage

func (repo *MySQLRepo) GetManageNetworkListWithPage(limit uint, offset uint) ([]model.ManageNetwork, error)

func (*MySQLRepo) GetManufacturerByDeviceID

func (repo *MySQLRepo) GetManufacturerByDeviceID(deviceId uint) (*model.Manufacturer, error)

func (*MySQLRepo) GetManufacturerByDeviceId

func (repo *MySQLRepo) GetManufacturerByDeviceId(deviceId uint) (*model.Manufacturer, error)

func (*MySQLRepo) GetManufacturerById

func (repo *MySQLRepo) GetManufacturerById(id uint) (*model.Manufacturer, error)

func (*MySQLRepo) GetManufacturerBySn

func (repo *MySQLRepo) GetManufacturerBySn(sn string) (*model.Manufacturer, error)

func (*MySQLRepo) GetManufacturerCompanyByGroup

func (repo *MySQLRepo) GetManufacturerCompanyByGroup(where string) ([]model.Manufacturer, error)

func (*MySQLRepo) GetManufacturerIdBySn

func (repo *MySQLRepo) GetManufacturerIdBySn(sn string) (uint, error)

func (*MySQLRepo) GetManufacturerListWithPage

func (repo *MySQLRepo) GetManufacturerListWithPage(limit uint, offset uint, where string) ([]model.ManufacturerFull, error)

func (*MySQLRepo) GetManufacturerMacBySn

func (repo *MySQLRepo) GetManufacturerMacBySn(sn string) (string, error)

func (*MySQLRepo) GetManufacturerModelNameByGroup

func (repo *MySQLRepo) GetManufacturerModelNameByGroup(where string) ([]model.Manufacturer, error)

func (*MySQLRepo) GetManufacturerProductByGroup

func (repo *MySQLRepo) GetManufacturerProductByGroup(where string) ([]model.Manufacturer, error)

func (*MySQLRepo) GetManufacturerSnByNicMacForVm

func (repo *MySQLRepo) GetManufacturerSnByNicMacForVm(mac string) (string, error)

func (*MySQLRepo) GetMaxVncPort

func (repo *MySQLRepo) GetMaxVncPort(where string) (uint, error)

func (*MySQLRepo) GetMemoryUsedSum

func (repo *MySQLRepo) GetMemoryUsedSum(where string) (uint, error)

func (*MySQLRepo) GetModelNameByWhereAndGroup

func (repo *MySQLRepo) GetModelNameByWhereAndGroup(where string) ([]model.Hardware, error)

func (*MySQLRepo) GetNeedCollectDeviceForVmHost

func (repo *MySQLRepo) GetNeedCollectDeviceForVmHost(deviceId uint) ([]model.Device, error)

func (*MySQLRepo) GetNetworkById

func (repo *MySQLRepo) GetNetworkById(id uint) (*model.Network, error)

func (*MySQLRepo) GetNetworkBySn

func (repo *MySQLRepo) GetNetworkBySn(sn string) (*model.Network, error)

func (*MySQLRepo) GetNetworkByVmMac

func (repo *MySQLRepo) GetNetworkByVmMac(sn string) (*model.Network, error)

func (*MySQLRepo) GetNetworkIdByNetwork

func (repo *MySQLRepo) GetNetworkIdByNetwork(network string) (uint, error)

func (*MySQLRepo) GetNetworkListWithPage

func (repo *MySQLRepo) GetNetworkListWithPage(limit uint, offset uint) ([]model.Network, error)

func (*MySQLRepo) GetNotUsedIPListByNetworkId

func (repo *MySQLRepo) GetNotUsedIPListByNetworkId(network_id uint) ([]model.Ip, error)

func (*MySQLRepo) GetOsConfigById

func (repo *MySQLRepo) GetOsConfigById(id uint) (*model.OsConfig, error)

func (*MySQLRepo) GetOsConfigByName

func (repo *MySQLRepo) GetOsConfigByName(name string) (*model.OsConfig, error)

func (*MySQLRepo) GetOsConfigIdByName

func (repo *MySQLRepo) GetOsConfigIdByName(name string) (uint, error)

func (*MySQLRepo) GetOsConfigListWithPage

func (repo *MySQLRepo) GetOsConfigListWithPage(limit uint, offset uint) ([]model.OsConfig, error)

func (*MySQLRepo) GetParentLocationIdByName

func (repo *MySQLRepo) GetParentLocationIdByName(name string) (uint, error)

func (*MySQLRepo) GetPlatformConfigById

func (repo *MySQLRepo) GetPlatformConfigById(id uint) (*model.PlatformConfig, error)

func (*MySQLRepo) GetPlatformConfigByName

func (repo *MySQLRepo) GetPlatformConfigByName(name string) (*model.PlatformConfig, error)

func (*MySQLRepo) GetPlatformConfigIdByName

func (repo *MySQLRepo) GetPlatformConfigIdByName(name string) (uint, error)

func (*MySQLRepo) GetPlatformConfigListWithPage

func (repo *MySQLRepo) GetPlatformConfigListWithPage(limit uint, offset uint) ([]model.PlatformConfig, error)

func (*MySQLRepo) GetProductByWhereAndGroup

func (repo *MySQLRepo) GetProductByWhereAndGroup(where string) ([]model.Hardware, error)

func (*MySQLRepo) GetSystemBySn

func (repo *MySQLRepo) GetSystemBySn(sn string) (*model.SystemConfig, error)

func (*MySQLRepo) GetSystemByVmMac

func (repo *MySQLRepo) GetSystemByVmMac(sn string) (*model.SystemConfig, error)

func (*MySQLRepo) GetSystemConfigById

func (repo *MySQLRepo) GetSystemConfigById(id uint) (*model.SystemConfig, error)

func (*MySQLRepo) GetSystemConfigIdByName

func (repo *MySQLRepo) GetSystemConfigIdByName(name string) (uint, error)

func (*MySQLRepo) GetSystemConfigListWithPage

func (repo *MySQLRepo) GetSystemConfigListWithPage(limit uint, offset uint) ([]model.SystemConfig, error)

func (*MySQLRepo) GetUserByAccessToken

func (repo *MySQLRepo) GetUserByAccessToken(accessToken string) (*model.UserWithToken, error)

func (*MySQLRepo) GetUserById

func (repo *MySQLRepo) GetUserById(id uint) (*model.User, error)

func (*MySQLRepo) GetUserByUsername

func (repo *MySQLRepo) GetUserByUsername(username string) (*model.User, error)

func (*MySQLRepo) GetUserByWhere

func (repo *MySQLRepo) GetUserByWhere(where string) (*model.User, error)

func (*MySQLRepo) GetUserListWithPage

func (repo *MySQLRepo) GetUserListWithPage(limit uint, offset uint, where string) ([]model.User, error)

func (*MySQLRepo) GetVmDeviceById

func (repo *MySQLRepo) GetVmDeviceById(id uint) (*model.VmDevice, error)

func (*MySQLRepo) GetVmDeviceByMac

func (repo *MySQLRepo) GetVmDeviceByMac(mac string) (*model.VmDevice, error)

func (*MySQLRepo) GetVmDeviceIdByMac

func (repo *MySQLRepo) GetVmDeviceIdByMac(mac string) (uint, error)

func (*MySQLRepo) GetVmDeviceListWithPage

func (repo *MySQLRepo) GetVmDeviceListWithPage(limit uint, offset uint, where string) ([]model.VmDeviceFull, error)

func (*MySQLRepo) GetVmDeviceLogById

func (repo *MySQLRepo) GetVmDeviceLogById(id uint) (*model.VmDeviceLog, error)

func (*MySQLRepo) GetVmDeviceLogListByDeviceID

func (repo *MySQLRepo) GetVmDeviceLogListByDeviceID(deviceID uint, order string) ([]model.VmDeviceLog, error)

func (*MySQLRepo) GetVmDeviceLogListByDeviceIDAndType

func (repo *MySQLRepo) GetVmDeviceLogListByDeviceIDAndType(deviceID uint, logType string, order string, maxId uint) ([]model.VmDeviceLog, error)

func (*MySQLRepo) GetVmHostById

func (repo *MySQLRepo) GetVmHostById(id uint) (*model.VmHost, error)

func (*MySQLRepo) GetVmHostBySn

func (repo *MySQLRepo) GetVmHostBySn(sn string) (*model.VmHost, error)

func (*MySQLRepo) GetVmHostListWithPage

func (repo *MySQLRepo) GetVmHostListWithPage(limit uint, offset uint, where string) ([]model.VmHostFull, error)

func (*MySQLRepo) ImportLocation

func (repo *MySQLRepo) ImportLocation(name string) (uint, error)

func (*MySQLRepo) IsInstallTimeoutDevice

func (repo *MySQLRepo) IsInstallTimeoutDevice(timeout int, deviceId uint) (bool, error)

func (*MySQLRepo) ReInstallDeviceById

func (repo *MySQLRepo) ReInstallDeviceById(id uint) (*model.Device, error)

func (*MySQLRepo) ReInstallVmDeviceById

func (repo *MySQLRepo) ReInstallVmDeviceById(id uint) (*model.VmDevice, error)

func (*MySQLRepo) RollbackHardwareFromBackupTable

func (repo *MySQLRepo) RollbackHardwareFromBackupTable(fix string) error

func (*MySQLRepo) UpdateDeviceById

func (repo *MySQLRepo) UpdateDeviceById(id uint, batchNumber string, sn string, hostname string, ip string, manageIp string, networkId uint, manageNetworkId uint, osId uint, hardwareId uint, systemId uint, location string, locationId uint, assetNumber string, status string, isSupportVm string, userID uint) (*model.Device, error)

func (*MySQLRepo) UpdateDeviceInstallCallbackByID

func (repo *MySQLRepo) UpdateDeviceInstallCallbackByID(Id uint, DeviceID uint, CallbackType string, Content string, RunTime string, RunResult string, RunStatus string) (*model.DeviceInstallCallback, error)

func (*MySQLRepo) UpdateDeviceInstallCallbackRunInfoByID

func (repo *MySQLRepo) UpdateDeviceInstallCallbackRunInfoByID(Id uint, RunTime string, RunResult string, RunStatus string) (*model.DeviceInstallCallback, error)

func (*MySQLRepo) UpdateDeviceLogTypeByDeviceIdAndType

func (repo *MySQLRepo) UpdateDeviceLogTypeByDeviceIdAndType(deviceId uint, logType string, newLogType string) ([]model.DeviceLog, error)

func (*MySQLRepo) UpdateDhcpSubnetById

func (repo *MySQLRepo) UpdateDhcpSubnetById(id uint, startIp string, endIp string, gateway string) (*model.DhcpSubnet, error)

func (*MySQLRepo) UpdateHardwareById

func (repo *MySQLRepo) UpdateHardwareById(id uint, company string, product string, modelName string, raid string, oob string, bios string, tpl string, data string, source string, version string, status string) (*model.Hardware, error)

func (*MySQLRepo) UpdateHistoryDeviceStatusById

func (repo *MySQLRepo) UpdateHistoryDeviceStatusById(id uint, status string) (*model.DeviceHistory, error)

func (*MySQLRepo) UpdateInstallInfoById

func (repo *MySQLRepo) UpdateInstallInfoById(id uint, status string, installProgress float64) (*model.Device, error)

func (*MySQLRepo) UpdateLocationById

func (repo *MySQLRepo) UpdateLocationById(id uint, pid uint, name string) (*model.Location, error)

func (*MySQLRepo) UpdateManageNetworkById

func (repo *MySQLRepo) UpdateManageNetworkById(id uint, network string, netmask string, gateway string, vlan string, trunk string, bonding string) (*model.ManageNetwork, error)

func (*MySQLRepo) UpdateManufacturerBootosLastActiveTimeBySn

func (repo *MySQLRepo) UpdateManufacturerBootosLastActiveTimeBySn(sn string, time string) (*model.Manufacturer, error)

func (*MySQLRepo) UpdateManufacturerById

func (repo *MySQLRepo) UpdateManufacturerById(id uint, company string, product string, modelName string, sn string, ip string, mac string, nic string, cpu string, cpuSum uint, memory string, memorySum uint, disk string, diskSum uint, motherboard string, raid string, oob string, isVm string, nicDevice string, isShowInScanList string) (*model.Manufacturer, error)

func (*MySQLRepo) UpdateManufacturerDeviceIdById

func (repo *MySQLRepo) UpdateManufacturerDeviceIdById(id uint, deviceId uint) (*model.Manufacturer, error)

func (*MySQLRepo) UpdateManufacturerIPById

func (repo *MySQLRepo) UpdateManufacturerIPById(id uint, ip string) (*model.Manufacturer, error)

func (*MySQLRepo) UpdateManufacturerIsShowInScanListById

func (repo *MySQLRepo) UpdateManufacturerIsShowInScanListById(id uint, isShowInScanList string) (*model.Manufacturer, error)

func (*MySQLRepo) UpdateNetworkById

func (repo *MySQLRepo) UpdateNetworkById(id uint, network string, netmask string, gateway string, vlan string, trunk string, bonding string) (*model.Network, error)

func (*MySQLRepo) UpdateOsConfigById

func (repo *MySQLRepo) UpdateOsConfigById(id uint, name string, pxe string) (*model.OsConfig, error)

func (*MySQLRepo) UpdatePlatformConfigById

func (repo *MySQLRepo) UpdatePlatformConfigById(id uint, name string, content string) (*model.PlatformConfig, error)

func (*MySQLRepo) UpdateSystemConfigById

func (repo *MySQLRepo) UpdateSystemConfigById(id uint, name string, content string) (*model.SystemConfig, error)

func (*MySQLRepo) UpdateUserById

func (repo *MySQLRepo) UpdateUserById(id uint, password string, name string, phoneNumber string, permission string, status string, role string) (*model.User, error)

func (*MySQLRepo) UpdateVmDeviceById

func (repo *MySQLRepo) UpdateVmDeviceById(
	Id uint,
	DeviceID uint,
	Hostname string,
	Mac string,
	Ip string,
	NetworkID uint,
	OsID uint,
	SystemID uint,
	CpuCoresNumber uint,
	CpuHotPlug string,
	CpuPassthrough string,
	CpuTopSockets uint,
	CpuTopCores uint,
	CpuTopThreads uint,
	CpuPinning string,
	MemoryCurrent uint,
	MemoryMax uint,
	MemoryKsm string,
	DiskType string,
	DiskSize uint,
	DiskBusType string,
	DiskCacheMode string,
	DiskIoMode string,
	NetworkType string,
	NetworkDeviceType string,
	DisplayType string,
	DisplayPassword string,
	DisplayUpdatePassword string,
	Status string,
	UserID uint,
	VncPort string,
	RunStatus string) (model.VmDevice, error)

func (*MySQLRepo) UpdateVmDeviceLogTypeByDeviceIdAndType

func (repo *MySQLRepo) UpdateVmDeviceLogTypeByDeviceIdAndType(deviceId uint, logType string, newLogType string) ([]model.VmDeviceLog, error)

func (*MySQLRepo) UpdateVmHostById

func (repo *MySQLRepo) UpdateVmHostById(id uint, cpuSum uint, cpuUsed uint, cpuAvailable uint, memorySum uint, memoryUsed uint, memoryAvailable uint, diskSum uint, diskUsed uint, diskAvailable uint, isAvailable string, remark string, vmNum uint) (*model.VmHost, error)

func (*MySQLRepo) UpdateVmHostCpuMemoryDiskVmNumById

func (repo *MySQLRepo) UpdateVmHostCpuMemoryDiskVmNumById(id uint, cpuSum uint, cpuUsed uint, cpuAvailable uint, memorySum uint, memoryUsed uint, memoryAvailable uint, diskSum uint, diskUsed uint, diskAvailable uint, vmNum uint, isAvailable string) (*model.VmHost, error)

func (*MySQLRepo) UpdateVmInstallInfoById

func (repo *MySQLRepo) UpdateVmInstallInfoById(id uint, status string, installProgress float64) (*model.VmDevice, error)

func (*MySQLRepo) UpdateVmRunStatusById

func (repo *MySQLRepo) UpdateVmRunStatusById(id uint, runStatus string) (*model.VmDevice, error)

func (*MySQLRepo) ValidateHardwareProductModel

func (repo *MySQLRepo) ValidateHardwareProductModel(company string, product string, modelName string) (bool, error)

type ResourceType

type ResourceType string

ResourceType 权限资源类型

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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