package com.bocloud.ims.entity.resource;

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 lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * @Company: 博云 www.bocloud.com
 * @ClassName: NetworkInterface
 * @Description:Azure云的网络接口
 * @author: zhenpingLi/李振平
 * @date: 2019/9/27 14:52
 */
@Table("network_interface")
@Data
public class NetworkInterface extends GenericEntity {

	@PK(PKStrategy.AUTO)
	private Long id;// ID
	@Column("network_interface_uuid")
	private String networkInterfaceUuid;
	@Column("region_id")
	private String regionId;// 所属域
	@Column("azure_resource_group_name")
	private String azureResourceGroupName; // azure 资源组名称
	@Column("resource_group_id")
	private Long resourceGroupId; //azure 资源组名称
	@Column("vendor_id")
	private Long vendorId;// 所属云平台
	@Column("security_group_id")
	private Long securityGroupId;
	@Column("vpc_id")
	private Long vpcId;
	@Column("server_id")
	private Long serverId;
	@Column("subnet_name")
	private String subnetName;
	@Column("primary_private_ip_address")
	private String primaryPrivateIPAddress;
	@Column("public_ip_address")
	private String publicIPAddress;
	@Column("mac_address")
	private String macAddress;
	@Column("zone")
	private String zone;
	@Column("subnet_id")
	private Long subnetId;
	@Column("interface_type")
	private String interfaceType;
	@Column("attached_time")
	private Date attachedTime;// 挂载时间
	@Column("detached_time")
	private Date detachedTime;// 卸载时间
	@Column("attachment_uuid")
	private String attachmentUuid;// 依附uuid
	@Column("device_index")
	private Integer deviceIndex;// 装置位置
	@Column("delete_on_termination")
	private boolean deleteOnTermination;// 随实例终止
	@Column("sgroup_uuid")
	private String sgroupUuid;
	@Column("nics_primary")
	private boolean nicsPrimary;// 是否是主网卡
	@Column("tenant_id")
	private Long tenantId;
	@Column("project_id")
	private Long projectId;
	@Column("user_id")
	private Long userId;
	@Column("private_ip_address")
	private String privateIPAddress;// 辅助私网IP
	@Column("ipv6_address")
	private String ipv6Address;
	@Column("resource_group_uuid")
	private String resourceGroupUuid;// 资源组id
	@Column("nat_gateway_uuid")
	private String natGatewayUuid;// 如果网关是通过nat网关创建时有值，其他时候为空
	@IgnoreAll
	private String tenantName;
	@IgnoreAll
	private String securityGroupName;
	@IgnoreAll
	private String vendorName;
	@IgnoreAll
	private String serverName;
	@IgnoreAll
	private String vpcName;
	@IgnoreAll
	private List<String> securityGroups;
	@IgnoreAll
	private String vpcUuid;
	@IgnoreAll
	private String subnetUuid;
	@IgnoreAll
	private String serverUuid;
	@IgnoreAll
	private String networkUuid;
	@IgnoreAll
	private List<String> awsGroupNames;
	@IgnoreAll
	private String regionName;
	@IgnoreAll
	private String zoneName;
	@IgnoreAll
	private String resourceGroupName;

	public static enum InterfaceType {
		Primary, // 主网卡
		Secondary // 辅助网卡
	}

}
