package com.bocloud.ims.interfaces.resource;

import java.util.List;

import com.bocloud.cmp.model.SubnetParam;
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.Subnet;

public interface SubnetService {

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

    /**
     * 创建
     *
     * @param params
     * @param user
     * @return
     */
    public BocloudResult create(Subnet subnet, RequestContext context);

    /**
     * 修改
     *
     * @param params
     * @param user
     * @return
     */
    public BocloudResult<String> modify(Subnet subnet, RequestContext context);

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

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

    /**
     * 根据云平台查询
     *
     * @param vendorId
     * @param networkId
     * @param tenantUuid
     * @return
     */
    public BocloudResult<List<Subnet>> listByVendorId(Long vendorId, Long networkId, String tenantUuid);

    /**
     * 查询指定路由连接的子网
     *
     * @param vendorId
     * @param routerId
     * @return
     */
    public BocloudResult<List<Subnet>> listAttachByRouter(Long vendorId, Long routerId);

    /**
     * 查询未连接该路由的子网
     *
     * @param vendorId
     * @param routerId
     * @param networkId
     * @param tenantUuid
     * @return
     */
    public BocloudResult<List<Subnet>> listDetachByRouter(Long vendorId, Long routerId, Long networkId,
        String tenantUuid);

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

    public BocloudResult<List<Subnet>> condition(String condition);

    public BocloudResult operations(Long id, SubnetParam subnetParam, RequestContext context);

    public BocloudResult associateIpv6(Long id, RequestContext context, String ipv6Cidr);

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

    public BocloudResult updateRouteTable(Long id, Long routeTableId, RequestContext context);

    BocloudResult listByNetworkUnSA( Long networkId);
}
