package com.bocloud.cmp.provider.compute;

import com.bocloud.cmp.model.HostOperateModel;
import com.bocloud.cmp.provider.SuperProvider;
import com.bocloud.common.model.BocloudResult;

/**
 * 宿主机操作服务接口
 *
 * @author weiwei
 */
public interface HostProvider extends SuperProvider {
    /**
     * 创建宿主机
     *
     * @param model
     * @return
     */
    default BocloudResult create(HostOperateModel model) {
        return null;
    }

    /**
     * 修改宿主机
     *
     * @param model
     * @return
     */
    public default BocloudResult modify(HostOperateModel model) {
        return null;
    }

    /**
     * 删除宿主机
     *
     * @param model
     * @return
     */
    public BocloudResult remove(HostOperateModel model);

    /**
     * 进入维护模式
     *
     * @param model
     * @return
     */
    public BocloudResult enterMode(HostOperateModel model);

    /**
     * 退出维护模式
     *
     * @param model
     * @return
     */
    public BocloudResult exitMode(HostOperateModel model);

    /**
     * 断开连接
     *
     * @param model
     * @return
     */
    public BocloudResult disconn(HostOperateModel model);

    /**
     * 重连
     *
     * @param model
     * @return
     */
    public BocloudResult reconn(HostOperateModel model);

    /**
     * 移动
     *
     * @param model
     * @return
     */
    public BocloudResult moveTo(HostOperateModel model);

    /**
     * 关机
     *
     * @param model
     * @return
     */
    public BocloudResult shutdown(HostOperateModel model);

    /**
     * 重启
     *
     * @param model
     * @return
     */
    public BocloudResult reboot(HostOperateModel model);

    /**
     * 查询详情
     *
     * @param model
     * @return
     */
    public BocloudResult detail(HostOperateModel model);

    public BocloudResult list();

    public BocloudResult monitor();

    public BocloudResult listPerf();

    public BocloudResult summary(Long id);

    public BocloudResult detail(Long hostId);

    public BocloudResult list(String clusterId);

    default public BocloudResult listUnmanagedPowervm(String hostname) {
        return new BocloudResult(false, "need implement");
    }

    default BocloudResult listHosts() {
        return null;
    }

    default BocloudResult listByCluster(String clusterName) {
        return null;
    }
}
