package com.bocloud.ims.interfaces.resource;

import com.bocloud.cmp.model.VpcOperationParam;
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.GridBean;
import com.bocloud.common.model.Pager;
import com.bocloud.common.model.RequestContext;
import com.bocloud.ims.entity.resource.CidrBlock;
import com.bocloud.ims.entity.resource.Vpc;

import java.util.List;

/**
 * vpc service实现
 *
 * @author wangyu
 * @version 1.0
 * @since 2018年2月2日
 */
public interface VpcService {

    public BocloudResult<GridBean<Vpc>> list(Pager pager, RequestContext context);

    public BocloudResult<String> create(Vpc vpc, RequestContext context);

    public BocloudResult<String> modify(Vpc vpc, RequestContext context);

    public BocloudResult<String> remove(Long id, RequestContext context);

    public BocloudResult<Vpc> detail(Long id);

    /**
     * 根据zone查询
     *
     * @param params
     * @param context
     * @return
     */
    public BocloudResult<List<Vpc>> listByZone(String params, RequestContext context);

    /**
     * vpc批量删除操作
     *
     * @param params
     * @param context
     * @return
     */
    public BocloudResult<String> batchRemove(List<Long> ids, RequestContext context);

    /**
     * 申请vpc
     *
     * @param application
     * @return
     */
    public BocloudResult apply(ApplicationParam application);

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

    /**
     * vpc退订
     *
     * @param param
     * @return
     */
    BocloudResult cancelation(CancelationParam param);

    /**
     * vpc操作类
     *
     * @param vpcOperationParam
     * @param context
     * @return
     */
    public BocloudResult operations(Long id, VpcOperationParam vpcOperationParam, RequestContext context);

    public BocloudResult<GridBean<CidrBlock>> cidrs(Pager pager, RequestContext context);

    public BocloudResult associate(Long id, RequestContext context, String cidr);

    public BocloudResult associateIpv6(Long id, RequestContext context);

    public BocloudResult disassociate(Long id, RequestContext context, Long cidrId);

    /**
     * condition方式查询VPC列表
     *
     * @param condition
     * @param context
     * @return
     */
    public BocloudResult<List<Vpc>> condition(String condition, RequestContext context);

    BocloudResult withDdos(Long id, Long planId, RequestContext context);

    BocloudResult withoutDdos(Long id, RequestContext context);

}
