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.VolumePool;

import java.util.List;

/**
 * @author luyanchao
 * @since 2019/3/4 14:05
 */
public interface VolumePoolService {

	/**
	 * 列表展示
	 *
	 * @param page
	 * @param rows
	 * @param params
	 * @param sorter
	 * @return
	 */
	public BocloudResult<GridBean<VolumePool>> list(Pager pager);

	/**
	 * 按存储器id查询存储池
	 *
	 * @param storageId
	 * @return
	 */
	public BocloudResult<List<VolumePool>> listByStorage(long storageId);

	/**
	 * 创建存储池
	 * 
	 * @param pool
	 * @param context
	 * @return
	 */
	public BocloudResult<String> create(VolumePool pool, RequestContext context);

	/**
	 * 修改存储池
	 * 
	 * @param pool
	 * @param context
	 * @return
	 */
	public BocloudResult<String> modify(VolumePool pool, RequestContext context);

	/**
	 * 删除存储池
	 * 
	 * @param poolId
	 * @param force
	 * @param context
	 * @return
	 */
	public BocloudResult<String> remove(long poolId, boolean force, RequestContext context);

	/**
	 * 存储池详情
	 * 
	 * @param poolId
	 * @return
	 */
	public BocloudResult<VolumePool> detail(long poolId);

	/**
	 * 为存储池添加成员（磁盘或OSD）
	 * 
	 * @param poolId
	 * @param memberIds
	 * @return
	 */
	public BocloudResult<String> addMember(long poolId, List<Long> memberIds, RequestContext context);

	/**
	 * 为存储池删除成员（磁盘或OSD）
	 * 
	 * @param poolId
	 * @param memberIds
	 * @return
	 */
	public BocloudResult<List<Long>> removeMember(long poolId, List<Long> memberIds, RequestContext context);

}
