package com.bocloud.ims.entity.middleware;

import com.bocloud.common.utils.DateDeserializer;
import com.bocloud.common.utils.DateSerializer;
import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.IgnoreUpdate;
import com.bocloud.entity.annotations.PK;
import com.bocloud.entity.annotations.Table;
import com.bocloud.entity.bean.GenericEntity;
import com.bocloud.entity.meta.PKStrategy;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * K8s节点
 * 
 * @author weiwei
 *
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Table("k8s_node")
public class K8sNode extends GenericEntity {

	@PK(PKStrategy.AUTO)
	private Long id;// ID
	@Column("name")
	private String name;
	@Column("role")
	private String role;
	@Column("status")
	private String status;
	@Column("instance_id")
	private String instanceId;
	@Column("cluster_id")
	private Long clusterId;
	@Column("vendor_id")
	private Long vendorId;
	@Column("username")
	private String username;
	@Column("password")
	private String password;
	@Column("specs")
	private String specs;
	@Column("ssh_port")
	private Integer sshPort;
	@Column("network")
	private String network;
	@Column("gmt_create")
	@IgnoreUpdate
	@JsonSerialize(using = DateSerializer.class)
	@JsonDeserialize(using = DateDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date gmtCreate;
	@Column("gmt_modify")
	@JsonSerialize(using = DateSerializer.class)
	@JsonDeserialize(using = DateDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date gmtModify;
}
