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

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;

import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * pvc
 * 
 * @author Administrator
 *
 */
@Table("kube_persistent_volume_claim")
@Data
public class KubePersistentVolumeClaim extends GenericEntity {

	@PK(value = PKStrategy.AUTO)
	private Long id; // ID
	@Column("instance_id")
	private String instanceId;// 实例ID
	@Column("vendor_id")
	private Long vendorId; // 云供应商Id
	@Column("yaml_text")
	private String yamlText;
	@Column("ns_id")
	private Long nsId; // 命名空间ID
	@Column("ns_name")
	private String namespace;
	@Column("access_modes")
	private String accessModes;
	@Column("volume_mode")
	private String volumeMode;
	@Column("reclaim_policy")
	private String reclaimPolicy;
	@Column("capacity")
	private String capacity;
	@Column("source")
	private String source;
	@Column("storage_class")
	private String storageClass;
	@Column("storage_amount")
	private String storageAmount;
	@Column("labels")
	private String labels;
	@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("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;
	@Column("tenant_id")
	private Long tenantId;
	@Column("message")
	private String message;
	@Column("reason")
	private String reason;
	@Column("volume_name")
	private String volumeName;

	@Column("storageclass_type")
	private String storageClassType;
	@Column("storageclass_name")
	private String storageClassName;

	@IgnoreAll
	private String unit;
	@IgnoreAll
	private Long namespaceId;

}
