package com.bocloud.ims.entity.resource;

import java.math.BigDecimal;

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.Generic;
import com.bocloud.entity.meta.PKStrategy;
import com.bocloud.ims.entity.util.ObjectSerializer;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import lombok.Data;

/**
 * 配置实体类
 *
 * @author dongkai
 */
@Table("flavor")
@Data
public class Flavor extends Generic {

	@PK(value = PKStrategy.AUTO)
	private Long id; // ID
	@Column("name")
	private String name; // 名称
	@Column("flavor_uuid")
	private String flavorUuid; // 配置的ID
	@Column("memory")
	private BigDecimal memory; // RAM
	@Column("cpu")
	private Integer cpu; // CPU
	@Column("disk")
	private Integer disk; // 磁盘
	@Column("vendor_id")
	private Long vendorId; // 云供应商ID
	@IgnoreAll
	private String vendorName; // 云供应商名称
	@Column("family")
	private String family;// 规格族
	@Column("performance_type")
	private String performanceType;

	@Column("status")
	private String status; // 状态
	@Column("instance_charge_type")
	private String instanceChargeType; // 付费类型
	@Column("zone")
	private String zone; // 区域

	@Column("extra_specs_id")
	private Long extraSpecsId; // 对应在flavor_extra_specs表中的ID

	@JsonSerialize(using = ObjectSerializer.class)
	@Column("os_extra_specs")
	private Object osExtraSpecs;
	@JsonSerialize(using = ObjectSerializer.class)
	@Column("attachable_quantity")
	private Object attachableQuantity;
	@Column("cpu_architecture")
	private String cpuArchitecture;

	@Column("region_id")
	private String regionId;
	@Column("availability_zone_ids")
	private String availabilityZoneIds;
	@Column("available")
	private Boolean available;
	@IgnoreAll
	private String regionName;
	@IgnoreAll
	private String zoneName;
	@IgnoreAll
	private FlavorExtraSpecs extraSpecs;

	private Integer dataDiskMax; // 最大数据盘
	private Integer dataDiskMin;

}
