package com.bocloud.ims.interfaces.resource;

import com.alibaba.fastjson.JSONObject;
import com.bocloud.cmp.entity.enums.ResourceCategory;
import com.bocloud.cmp.vm.model.ResourceAssignParam;
import com.bocloud.common.model.BocloudResult;
import com.bocloud.common.model.GridBean;
import com.bocloud.common.model.Pager;
import com.bocloud.common.model.RequestContext;
import com.bocloud.ims.entity.resource.CloudServer;

import java.util.Map;

/**
 * 资源分配给项目service接口
 *
 * @author wangyu
 * @version 4.1.0-SNAPSHOT
 * @since 2019/2/28
 */
public interface ResourceAllocateService {

    /**
     * 分配资源
     *
     * @param object
     * @param category
     * @param context
     * @return
     */
    BocloudResult assign(JSONObject object, ResourceCategory category, RequestContext context);

    /**
     * 回收资源
     *
     * @param category
     * @param context
     * @return
     */
    BocloudResult reclaim(ResourceAssignParam vmAssignParam, ResourceCategory category, RequestContext context);

    /**
     * 资源分配清单
     */
    BocloudResult<GridBean<CloudServer>> resourceList(Pager pager, RequestContext context);

    /**
     * 查询到期云主机列表
     * @param pager
     * @param context
     * @return
     */
    BocloudResult<GridBean<CloudServer>> serverList(Pager pager, RequestContext context);

    /**
     * 下载资源分配的清单
     * @param time
     * @param context
     * @return
     */
    BocloudResult<Map<String, Object>> downLoadResourceList(String time, RequestContext context);

    /**
     * 下载到期云主机列表
     *
     * @param name
     * @param time
     * @param context
     * @return
     */
    BocloudResult<Map<String, Object>> downLoadServerList(String name, String time, RequestContext context);
}
