package com.bocloud.ims.interfaces.resource;

import com.alibaba.fastjson.JSONObject;
import com.bocloud.cmp.model.common.AlterationParam;
import com.bocloud.cmp.model.common.ApplicationParam;
import com.bocloud.cmp.model.common.CancelationParam;
import com.bocloud.cmp.model.common.ExtensionParam;
import com.bocloud.common.model.BocloudResult;
import com.bocloud.common.model.RequestContext;
import com.bocloud.ims.entity.resource.CloudServer;

import java.util.List;

/**
 * 虚拟机订购业务类接口
 *
 * @author weiwei
 */
public interface VMApplyService {

    /**
     * 虚拟机申请
     *
     * @param param
     * @return
     */
    BocloudResult apply(ApplicationParam param);

    /**
     * 进入回收站
     *
     * @param id
     * @param context
     * @return
     */
    BocloudResult recycle(Long id, RequestContext context);

    /**
     * 进入回收站(根据uuid)
     *
     * @param uuid
     * @param context
     * @return
     */
    BocloudResult recycle(String uuid, RequestContext context);

    /**
     * 退出回收站
     *
     * @param id
     * @param context
     * @return
     */
    BocloudResult restore(Long id, RequestContext context);

    /**
     * 获取回收站虚拟机
     *
     * @param vendorId
     * @return
     */
    List<CloudServer> getRecycleServers(Long vendorId);

    /**
     * 升级虚拟机配置(自服务)
     *
     * @param params
     * @param context
     * @return
     */
    BocloudResult upgradeConfig(String params, RequestContext context);

    /**
     * 退订云主机
     *
     * @param param
     * @return
     */
    BocloudResult cancelation(CancelationParam param);

    /**
     * 延期
     *
     * @param param
     * @return
     */
    BocloudResult extension(ExtensionParam param);

    /**
     * 格式化磁盘
     *
     * @param id
     * @param object
     * @param context
     * @return
     */
    BocloudResult formatDisk(Long id, JSONObject object, RequestContext context);

    /**
     * 虚拟机升级配置
     *
     * @param alteration
     * @return
     */
    BocloudResult alteration(AlterationParam alteration);

    BocloudResult createServer(JSONObject param, RequestContext context, String queue);

	BocloudResult batchRecycle(String param, RequestContext context);

}
