package com.bocloud.ims.interfaces.installation;

import com.bocloud.cmp.entity.enums.installation.InstallImageType;
import com.bocloud.cmp.model.installation.InstallOptions;
import com.bocloud.cmp.model.installation.InstallResultBeans;
import com.bocloud.cmp.model.installation.Options;
import com.bocloud.common.model.BocloudResult;
import com.bocloud.common.model.GridBean;
import com.bocloud.common.model.Pager;
import com.bocloud.ims.entity.installation.InstallTask;
import com.bocloud.ims.entity.resource.Server;

import java.util.Date;

/**
 * 任务管理接口
 *
 * @author sxp
 * @since Nov 15, 2017
 */
public interface InstallTaskService {

    /**
     * 查询任务历史
     *
     * @param pager
     * @return
     */
    BocloudResult<GridBean<InstallTask>> list(Pager pager);

    /**
     * 显示任务详情
     *
     * @param id
     * @return
     */
    BocloudResult<InstallResultBeans> detail(Long id);

    /**
     * 下发装机任务给rackhd
     *
     * @param rackHdNodeId
     * @param defaults
     * @param imageType
     * @param server
     * @param taskId
     * @param startTime
     * @return
     */
    BocloudResult install(String rackHdNodeId, InstallOptions defaults, InstallImageType imageType, Server server, Long taskId, Date startTime);

    /**
     * 下发RAID配置任务给rackhd
     *
     * @param server
     * @param defaults
     * @param taskId
     * @param startTime
     * @return
     */
    BocloudResult raid(Server server, Options defaults, Long taskId, Date startTime);

    /**
     * 下发发现任务给rackhd
     * <p>
     * 刷新机器driveId信息
     *
     * @param rackHdNodeId
     * @return
     */
    BocloudResult discovery(String rackHdNodeId);

}
