package com.bocloud.ims.entity.resource;

import com.bocloud.entity.annotations.*;
import com.bocloud.entity.bean.GenericEntity;
import com.bocloud.entity.meta.PKStrategy;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@Table("nat_gateway_dnat_rule")
public class NatGatewayDnatRule extends GenericEntity {

	// ID
	@PK(value = PKStrategy.AUTO)
	private Long id;
	@Column("vendor_id")
	private Long vendorId;
	// 地域
	@Column("region_id")
	private String regionId;
	@Column("uuid")
	private String uuid;
	@Column("nat_gateway_id")
	private Long natGatewayId;
	@Column("port_id")
	private Long portId; // 虚拟机或者裸机的Port ID,对应虚拟私有云场景,与private_ip参数二选一。
	@Column("private_ip")
	private String privateIp; // 用户私有IP地址,对应专线、云连接场景,与port_id参数二选一。
	@Column("elastic_ip_id")
	private Long elasticIpId; // 弹性公网IP的id。
	@Column("internal_service_port")
	private Integer internalServicePort; // 虚拟机或者裸机对外提供服务的协议端口号。取值范围:0~65535
	@Column("external_service_port")
	private Integer externalServicePort; // Floatingip对外提供服务的端口号。取值范围:0~65535。
	@Column("internal_service_port_range")
	private String internalServicePortRange;
	@Column("external_service_port_range")
	private String externalServicePortRange;
	@Column("protocol")
	private String protocol; // 协议类型,目前支持TCP/tcp、UDP/udp、ANY/any
	@Column("admin_state_up")
	private Boolean adminStateUp;
	@IgnoreAll
	private String elasticIp;

	public static enum Protocol {
		any, Any, TCP, UDP
	}

	/** 阿里云新增属性 **/
	@Column("forward_table_id")
	private String forwardTableId;
	@Column("port_break")
	private Boolean portBreak; // 是否开启端口突破,默认未开启，aliyun(当DNAT条目和SNAT条目使用同一个公网IP地址时，如果您想配置大于1024的端口号，您需要指定PortBreak为true。)
	@Column("floating_ip_address")
	private String floatingIpAddress; // 公网ip
	/** end **/

	@IgnoreAll
	private String natGatewayName;
	/*绑定的虚拟机id*/
	@IgnoreAll
	private Long vmId;
}
