package com.bocloud.ims.entity.resource;

import com.bocloud.common.utils.DateSerializer;
import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.PK;
import com.bocloud.entity.annotations.Table;
import com.bocloud.entity.bean.Generic;
import com.bocloud.entity.meta.PKStrategy;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * Server配置
 *
 * @author dongkai
 */
@Table("server_config")
public class ServerConfig extends Generic {

	@PK(value = PKStrategy.AUTO)
	private Long id; // ID
	@Column("username")
	private String username;
	@Column("password")
	private String password;
	@Column("ipmi_account")
	private String ipmiAccount;
	/**
	 * 装机节点IPMI所有用户
	 */
	@Column("ipmi_users")
	private String ipmiUsers;
	/**
	 * 装机节点IPMI所有地址信息
	 */
	@Column("ipmi_ips")
	private String ipmiIps;
	@Column("ipmi_password")
	private String ipmiPassword;
	@Column("ipmi_address")
	private String ipmiAddress;
	@Column("ipmi_port")
	private Integer ipmiPort;
	@Column("support_docker")
	private Boolean supportDocker;
	@Column("docker_version")
	private String dockerVersion;
	@Column("ceph_version")
	private String cephVersion;
	@Column("file_system")
	private String fileSystem;
	@Column("mac")
	private String mac;
	@Column("kernel_version")
	private String kernelVersion;
	@Column("virtualized")
	private Boolean virtualized;
	@Column("key_store")
	private String keyStore;
	@Column("vt_mode")
	private String vtMode;
	@Column("os_name")
	private String osName;
	@Column("os_version")
	private String osVersion;
	@Column("ssh_port")
	private Integer sshPort;
	@Column("cpu_vendor")
	private String cpuVendor;
	@Column("cpu_amount")
	private Integer cpuAmount;
	@Column("cpu_mode")
	private String cpuMode;
	@Column("cpu_core")
	private Integer cpuCore;
	@Column("cpu_hz")
	private Long cpuHz;
	@Column("memory_mode")
	private String memoryMode;
	@Column("memory_capacity")
	private Double memoryCapacity;
	@Column("swap_capacity")
	private Double swapCapacity;
	@Column("disk_capacity")
	private Double diskCapacity;
	@Column("bios_version")
	private String biosVersion;
	@Column("bios_vendor")
	private String biosVendor;
	@Column("bios_date")
	@JsonSerialize(using = DateSerializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date biosDate;
	@Column("server_id")
	private Long serverId;
	@Column("cpu_used")
	private Long cpuUsed;
	@Column("mem_used")
	private Double memUsed;
	@Column("mem_reserved")
	private Double memReserved; // 保留内存
	@Column("disk_used")
	private Double diskUsed;

	@Column("hmc_cpu")
	private Double hmcCpu; // 虚拟处理器单元数
	@Column("hmc_cpu_reserved")
	private Double hmcCpuReserved; // 保留处理器单元数
	@Column("hmc_cpu_used")
	private Double hmcCpuUsed; // 已用处理器单元数

	/**
	 * 厂商信息
	 */
	@Column("vendor")
	private String vendor;
	@Column("esx_version")
	private String esxVersion;
	@Column("evc")
	private String evc;
	@Column("assigned_license")
	private String assignedLicense;

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return the username
	 */
	public String getUsername() {
		return username;
	}

	/**
	 * @param username
	 *            the username to set
	 */
	public void setUsername(String username) {
		this.username = username;
	}

	/**
	 * @return the password
	 */
	public String getPassword() {
		return password;
	}

	/**
	 * @param password
	 *            the password to set
	 */
	public void setPassword(String password) {
		this.password = password;
	}

	/**
	 * @return the ipmiAccount
	 */
	public String getIpmiAccount() {
		return ipmiAccount;
	}

	/**
	 * @param ipmiAccount
	 *            the ipmiAccount to set
	 */
	public void setIpmiAccount(String ipmiAccount) {
		this.ipmiAccount = ipmiAccount;
	}

	/**
	 * @return the ipmiUsers
	 */
	public String getIpmiUsers() {
		return ipmiUsers;
	}

	/**
	 * @param ipmiUsers
	 *            the ipmiUsers to set
	 */
	public void setIpmiUsers(String ipmiUsers) {
		this.ipmiUsers = ipmiUsers;
	}

	/**
	 * @return the ipmiPassword
	 */
	public String getIpmiPassword() {
		return ipmiPassword;
	}

	/**
	 * @param ipmiPassword
	 *            the ipmiPassword to set
	 */
	public void setIpmiPassword(String ipmiPassword) {
		this.ipmiPassword = ipmiPassword;
	}

	/**
	 * @return the ipmiAddress
	 */
	public String getIpmiAddress() {
		return ipmiAddress;
	}

	/**
	 * @param ipmiAddress
	 *            the ipmiAddress to set
	 */
	public void setIpmiAddress(String ipmiAddress) {
		this.ipmiAddress = ipmiAddress;
	}

	/**
	 * @return the ipmiPort
	 */
	public Integer getIpmiPort() {
		return ipmiPort;
	}

	/**
	 * @param ipmiPort
	 *            the ipmiPort to set
	 */
	public void setIpmiPort(Integer ipmiPort) {
		this.ipmiPort = ipmiPort;
	}

	/**
	 * @return the supportDocker
	 */
	public Boolean getSupportDocker() {
		return supportDocker;
	}

	/**
	 * @param supportDocker
	 *            the supportDocker to set
	 */
	public void setSupportDocker(Boolean supportDocker) {
		this.supportDocker = supportDocker;
	}

	/**
	 * @return the dockerVersion
	 */
	public String getDockerVersion() {
		return dockerVersion;
	}

	/**
	 * @param dockerVersion
	 *            the dockerVersion to set
	 */
	public void setDockerVersion(String dockerVersion) {
		this.dockerVersion = dockerVersion;
	}

	/**
	 * @return the fileSystem
	 */
	public String getFileSystem() {
		return fileSystem;
	}

	/**
	 * @param fileSystem
	 *            the fileSystem to set
	 */
	public void setFileSystem(String fileSystem) {
		this.fileSystem = fileSystem;
	}

	/**
	 * @return the mac
	 */
	public String getMac() {
		return mac;
	}

	/**
	 * @param mac
	 *            the mac to set
	 */
	public void setMac(String mac) {
		this.mac = mac;
	}

	/**
	 * @return the kernelVersion
	 */
	public String getKernelVersion() {
		return kernelVersion;
	}

	/**
	 * @param kernelVersion
	 *            the kernelVersion to set
	 */
	public void setKernelVersion(String kernelVersion) {
		this.kernelVersion = kernelVersion;
	}

	/**
	 * @return the virtualized
	 */
	public Boolean getVirtualized() {
		return virtualized;
	}

	/**
	 * @param virtualized
	 *            the virtualized to set
	 */
	public void setVirtualized(Boolean virtualized) {
		this.virtualized = virtualized;
	}

	/**
	 * @return the keyStore
	 */
	public String getKeyStore() {
		return keyStore;
	}

	/**
	 * @param keyStore
	 *            the keyStore to set
	 */
	public void setKeyStore(String keyStore) {
		this.keyStore = keyStore;
	}

	/**
	 * @return the vtMode
	 */
	public String getVtMode() {
		return vtMode;
	}

	/**
	 * @param vtMode
	 *            the vtMode to set
	 */
	public void setVtMode(String vtMode) {
		this.vtMode = vtMode;
	}

	/**
	 * @return the osName
	 */
	public String getOsName() {
		return osName;
	}

	/**
	 * @param osName
	 *            the osName to set
	 */
	public void setOsName(String osName) {
		this.osName = osName;
	}

	/**
	 * @return the osVersion
	 */
	public String getOsVersion() {
		return osVersion;
	}

	/**
	 * @param osVersion
	 *            the osVersion to set
	 */
	public void setOsVersion(String osVersion) {
		this.osVersion = osVersion;
	}

	/**
	 * @return the sshPort
	 */
	public Integer getSshPort() {
		return sshPort;
	}

	/**
	 * @param sshPort
	 *            the sshPort to set
	 */
	public void setSshPort(Integer sshPort) {
		this.sshPort = sshPort;
	}

	/**
	 * @return the cpuVendor
	 */
	public String getCpuVendor() {
		return cpuVendor;
	}

	/**
	 * @param cpuVendor
	 *            the cpuVendor to set
	 */
	public void setCpuVendor(String cpuVendor) {
		this.cpuVendor = cpuVendor;
	}

	/**
	 * @return the cpuAmount
	 */
	public Integer getCpuAmount() {
		return cpuAmount;
	}

	/**
	 * @param cpuAmount
	 *            the cpuAmount to set
	 */
	public void setCpuAmount(Integer cpuAmount) {
		this.cpuAmount = cpuAmount;
	}

	/**
	 * @return the cpuMode
	 */
	public String getCpuMode() {
		return cpuMode;
	}

	/**
	 * @param cpuMode
	 *            the cpuMode to set
	 */
	public void setCpuMode(String cpuMode) {
		this.cpuMode = cpuMode;
	}

	/**
	 * @return the cpuCore
	 */
	public Integer getCpuCore() {
		return cpuCore;
	}

	/**
	 * @param cpuCore
	 *            the cpuCore to set
	 */
	public void setCpuCore(Integer cpuCore) {
		this.cpuCore = cpuCore;
	}

	/**
	 * @return the cpuHz
	 */
	public Long getCpuHz() {
		return cpuHz;
	}

	/**
	 * @param cpuHz
	 *            the cpuHz to set
	 */
	public void setCpuHz(Long cpuHz) {
		this.cpuHz = cpuHz;
	}

	/**
	 * @return the memoryMode
	 */
	public String getMemoryMode() {
		return memoryMode;
	}

	/**
	 * @param memoryMode
	 *            the memoryMode to set
	 */
	public void setMemoryMode(String memoryMode) {
		this.memoryMode = memoryMode;
	}

	/**
	 * @return the memoryCapacity
	 */
	public Double getMemoryCapacity() {
		return memoryCapacity;
	}

	/**
	 * @param memoryCapacity
	 *            the memoryCapacity to set
	 */
	public void setMemoryCapacity(Double memoryCapacity) {
		this.memoryCapacity = memoryCapacity;
	}

	/**
	 * @return the diskCapacity
	 */
	public Double getDiskCapacity() {
		return diskCapacity;
	}

	/**
	 * @param diskCapacity
	 *            the diskCapacity to set
	 */
	public void setDiskCapacity(Double diskCapacity) {
		this.diskCapacity = diskCapacity;
	}

	/**
	 * @return the biosVersion
	 */
	public String getBiosVersion() {
		return biosVersion;
	}

	/**
	 * @param biosVersion
	 *            the biosVersion to set
	 */
	public void setBiosVersion(String biosVersion) {
		this.biosVersion = biosVersion;
	}

	/**
	 * @return the biosVendor
	 */
	public String getBiosVendor() {
		return biosVendor;
	}

	/**
	 * @param biosVendor
	 *            the biosVendor to set
	 */
	public void setBiosVendor(String biosVendor) {
		this.biosVendor = biosVendor;
	}

	/**
	 * @return the biosDate
	 */
	public Date getBiosDate() {
		return biosDate;
	}

	/**
	 * @param biosDate
	 *            the biosDate to set
	 */
	public void setBiosDate(Date biosDate) {
		this.biosDate = biosDate;
	}

	/**
	 * @return the serverId
	 */
	public Long getServerId() {
		return serverId;
	}

	/**
	 * @param serverId
	 *            the serverId to set
	 */
	public void setServerId(Long serverId) {
		this.serverId = serverId;
	}

	/**
	 * @return the cpuUsed
	 */
	public Long getCpuUsed() {
		return cpuUsed;
	}

	/**
	 * @param cpuUsed
	 *            the cpuUsed to set
	 */
	public void setCpuUsed(Long cpuUsed) {
		this.cpuUsed = cpuUsed;
	}

	/**
	 * @return the memUsed
	 */
	public Double getMemUsed() {
		return memUsed;
	}

	/**
	 * @param memUsed
	 *            the memUsed to set
	 */
	public void setMemUsed(Double memUsed) {
		this.memUsed = memUsed;
	}

	/**
	 * @return the diskUsed
	 */
	public Double getDiskUsed() {
		return diskUsed;
	}

	/**
	 * @param diskUsed
	 *            the diskUsed to set
	 */
	public void setDiskUsed(Double diskUsed) {
		this.diskUsed = diskUsed;
	}

	/**
	 * @return the vendor
	 */
	public String getVendor() {
		return vendor;
	}

	/**
	 * @param vendor
	 *            the vendor to set
	 */
	public void setVendor(String vendor) {
		this.vendor = vendor;
	}

	public String getIpmiIps() {
		return ipmiIps;
	}

	public void setIpmiIps(String ipmiIps) {
		this.ipmiIps = ipmiIps;
	}

	public Double getHmcCpu() {
		return hmcCpu;
	}

	public void setHmcCpu(Double hmcCpu) {
		this.hmcCpu = hmcCpu;
	}

	public Double getHmcCpuReserved() {
		return hmcCpuReserved;
	}

	public void setHmcCpuReserved(Double hmcCpuReserved) {
		this.hmcCpuReserved = hmcCpuReserved;
	}

	public Double getHmcCpuUsed() {
		return hmcCpuUsed;
	}

	public void setHmcCpuUsed(Double hmcCpuUsed) {
		this.hmcCpuUsed = hmcCpuUsed;
	}

	public Double getMemReserved() {
		return memReserved;
	}

	public void setMemReserved(Double memReserved) {
		this.memReserved = memReserved;
	}

	public String getEsxVersion() {
		return esxVersion;
	}

	public void setEsxVersion(String esxVersion) {
		this.esxVersion = esxVersion;
	}

	public String getEvc() {
		return evc;
	}

	public void setEvc(String evc) {
		this.evc = evc;
	}

	public String getAssignedLicense() {
		return assignedLicense;
	}

	public void setAssignedLicense(String assignedLicense) {
		this.assignedLicense = assignedLicense;
	}

	public Double getSwapCapacity() {
		return swapCapacity;
	}

	public void setSwapCapacity(Double swapCapacity) {
		this.swapCapacity = swapCapacity;
	}

	public String getCephVersion() {
		return cephVersion;
	}

	public void setCephVersion(String cephVersion) {
		this.cephVersion = cephVersion;
	}
}
