package com.bocloud.ims.entity.resource.kubernetes;

import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;

import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.IgnoreAll;
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.Data;

/**
 * k8s部署
 * 
 * @author weiwei
 *
 */
@Table("kube_daemonset")
@Data
public class KubeDaemonSet extends GenericEntity {

	@PK(value = PKStrategy.AUTO)
	private Long id; // ID
	@Column("instance_id")
	private String instanceId;// 实例ID
	@Column("labels")
	private String labels;
	@Column("ns_id")
	private Long nsId; // 命名空间ID
	@Column("ns_name")
	private String namespace;
	@Column("vendor_id")
	private Long vendorId; // 云供应商Id
	@Column("yaml_text")
	private String yamlText;
	@Column("strategy")
	private String strategy; // 策略
	@Column("selector")
	private String selector; // 选择器
	@Column("tenant_id")
	private Long tenantId;
	@Column("project_id")
	private Long projectId;// 项目ID
	@Column("uid")
	private String uid;// uuid
	@Column("app_id")
	private Long appId;
	@Column("app_name")
	private String appName;
	@Column("kind")
	private String kind;
	@Column("api_version")
	private String apiVersion;

	@Column("vdc_id")
	private Long vdcId;
	@Column("poolgroup_id")
	private Long poolGroupId;

	@Column("requests_cpu")
	private String requestsCpu;
	@Column("limits_cpu")
	private String limitsCpu;
	@Column("requests_memory")
	private String requestsMemory;
	@Column("limits_memory")
	private String limitsMemory;
	@Column("pod_count")
	private Integer podCount;

	@IgnoreAll
	private String tenantName;// 所属租户
	@IgnoreAll
	private String vendorName;// 平台名称
	@IgnoreAll
	private String vendorType;// 平台类型
	@IgnoreAll
	private String projectVisibility;

	@IgnoreAll
	private String applicationName; // 实例名称
	@IgnoreAll
	private Integer replica; // 实例数
	/**
	 * 先创建再删除 strategyType: "RollingUpdate" 先删除再创建 strategyType: "Recreate"
	 */
	@IgnoreAll
	private String strategyType; // 策略
	@IgnoreAll
	private String instanceLabels; // 标签
	@IgnoreAll
	private String bocoPlatformPorts; // 服务
	
	@Column("creation_time")
	@JsonSerialize(using = com.bocloud.common.utils.DateSerializer.class)
	@JsonDeserialize(using = com.bocloud.common.utils.DateDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date creationTime;

}
