示例#1
0
func (handler *MiscHandlersImpl) GetVCHInfo() middleware.Responder {
	vchInfo := &models.VCHInfo{
		CPUMhz:          &exec.VCHConfig.VCHMhz,
		Memory:          &exec.VCHConfig.VCHMemoryLimit,
		HostOS:          &exec.VCHConfig.HostOS,
		HostOSVersion:   &exec.VCHConfig.HostOSVersion,
		HostProductName: &exec.VCHConfig.HostProductName,
	}

	return misc.NewGetVCHInfoOK().WithPayload(vchInfo)
}
示例#2
0
// GetVCHInfo returns VCH-related info for a `docker info` call
func (handler *MiscHandlersImpl) GetVCHInfo() middleware.Responder {
	ctx := context.Background()
	vchCPUMhz := exec.NCPU(ctx)
	vchMemLimit := exec.MemTotal(ctx)

	vchInfo := &models.VCHInfo{
		CPUMhz:          &vchCPUMhz,
		Memory:          &vchMemLimit,
		HostOS:          &exec.Config.HostOS,
		HostOSVersion:   &exec.Config.HostOSVersion,
		HostProductName: &exec.Config.HostProductName,
	}

	return misc.NewGetVCHInfoOK().WithPayload(vchInfo)
}