package com.bocloud.ims.interfaces.resource;

import com.bocloud.common.model.BocloudResult;
import com.bocloud.common.model.GridBean;
import com.bocloud.common.model.Pager;
import com.bocloud.ims.entity.resource.ResourceAlarm;

import java.util.List;

/**
 * 告警操作接口
 *
 * @author songsong
 */
public interface ResourceAlarmService {

    /**
     * 告警查询接口
     *
     * @param page
     * @param rows
     * @param params
     * @param sorter
     * @param simple
     * @return
     */
    BocloudResult<GridBean<ResourceAlarm>> list(Pager pager)
            throws Exception;

    /**
     * 添加告警信息
     *
     * @param alarm
     * @return
     */
    BocloudResult<ResourceAlarm> create(ResourceAlarm alarm);

    /**
     * 详情
     *
     * @param id
     * @return
     */
    BocloudResult<ResourceAlarm> detail(Long id);

    /**
     * 删除告警
     *
     * @param id
     * @return
     */
    BocloudResult<String> remove(Long id, Long userId);

    /**
     * 所有未确认的告警
     *
     * @return
     */
    List<ResourceAlarm> unconfirms(Boolean existRuleId);

    /**
     * 告警确认
     *
     * @param id
     * @param userId
     * @return
     */
    BocloudResult<String> confirm(Long id, Long userId);


    /**
     * 告警操作
     *
     * @param id
     * @param action
     * @param params
     * @param userId
     * @return
     */
    BocloudResult<String> action(Long id, String action, String params, Long userId);

    /**
     * 告警解决
     *
     * @param id
     * @param userId
     * @param dealResult
     * @return
     */
    BocloudResult<String> solve(Long id, Long userId, String dealResult);

    /**
     * 更新告警级别
     *
     * @param alarm
     * @return
     */
    BocloudResult<String> updateLevel(ResourceAlarm alarm);

    /**
     * 根据告警类别删除
     *
     * @param target
     * @param type
     * @return
     */
    BocloudResult<String> removeByTarget(String target, String type);

}
