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.common.model.RequestContext;
import com.bocloud.ims.entity.resource.Flavor;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

public interface FlavorService {

    /**
     * 列表展示
     *
     * @param pager
     * @param context
     * @return
     */
    BocloudResult<GridBean<Flavor>> list(Pager pager, RequestContext context);

    /**
     * 查询配置
     *
     * @param vendorId
     * @param name
     * @return
     */
    BocloudResult<List<Flavor>> listFlavor(Long vendorId, String name);

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

    /**
     * 创建
     *
     * @param flavor
     * @param context
     * @return
     */
    BocloudResult<String> create(Flavor flavor, RequestContext context);

    /**
     * 删除
     *
     * @param id
     * @param user
     * @return
     */
    BocloudResult<String> remove(Long id, RequestContext context);

    /**
     * 修改配置
     *
     * @param flavor
     * @param context
     * @return
     */
    BocloudResult<String> modify(Flavor flavor, RequestContext context);

    /**
     * 根据云平台ID查询
     *
     * @param vendorId
     * @return
     */
    BocloudResult<List<Flavor>> listByVendor(Long vendorId, String status);

    /**
     * 批量删除
     *
     * @param params
     * @param user
     * @return
     */
    BocloudResult batchRemove(List<Long> idArray, RequestContext context);

    /**
     * 通过condition方式查询虚机规格
     *
     * @param condition
     * @param context
     * @return
     */
    BocloudResult<List<Flavor>> condition(String condition, RequestContext context);

    BocloudResult<Void> status(Long id, String status);

    void downloadTemplate(HttpServletResponse response, Long vendorId);

    //批量导入
    BocloudResult<Map<String, String>> importCreate(List<Map<String, String>> flavor, Long vendorId);

}
