package com.bocloud.ims.entity.resource.azure.monitor;

import com.bocloud.common.utils.DateSerializer;
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.JsonSerialize;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 告警实体类
 *
 * @author wangyu
 * @Version 1.0
 * @since 2017年7月10日
 */
@Table("azure_alarm")
@Data
public class AzureAlarm extends GenericEntity {

    @PK(value = PKStrategy.AUTO)
    private Long id; // ID
    @Column("tenant_id")
    private Long tenantId;// 项目ID
    @Column("project_id")
    private Long projectId;// 项目ID
    @Column("user_id")
    private Long userId;
    @Column("vendor_id")
    private Long vendorId; // 云供应商Id
    @Column("level")
    private String level;// 警告等级
    @Column("type")
    private String type;// 目标机器类型
    @Column("target")
    private String target;// 目标机器
    @Column("gmt_trigger")
    @JsonSerialize(using = DateSerializer.class)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date gmtTrigger;// 告警触发时间
    @Column("gmt_confirm")
    @JsonSerialize(using = DateSerializer.class)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date gmtConfirm;// 告警确认时间
    @Column("alarm_id")
    private String alarmId;
    @Column("metric_alert_id")
    private Long metricAlertId;//指标警报ID
    @Column("signal_type")
    private String signalType;//信号类型
    @Column("monitor_condition")
    private String monitorCondition;//监控状态 Fired激发  Resolved已解决

    @IgnoreAll
    private String vendorName; // 云供应商名称
    @IgnoreAll
    private String uuid;
    @IgnoreAll
    private String metricAlertUuid;//指标警报uuid
    @IgnoreAll
    private MetricAlert metricAlert;

}