package cn.reghao.devops.mgr.app.db.query;

import cn.reghao.devops.common.agent.app.dto.AppInfo;
import cn.reghao.devops.mgr.app.model.po.config.AppConfig;
import cn.reghao.devops.mgr.app.model.po.config.AppDeployConfig;
import cn.reghao.devops.mgr.app.model.vo.AppDeployingNodeVO;
import cn.reghao.devops.mgr.app.model.vo.AppRunningNode;
import cn.reghao.devops.mgr.app.model.vo.AppRunning;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * @author reghao
 * @date 2021-06-02 15:01:18
 */
public interface AppDeployQuery {
    List<AppDeployConfig> getByAppId(String appId);
    List<AppDeployingNodeVO> get(String appId);
    List<AppInfo> getAppsByMachineId(String machineId);
    AppDeployConfig getByAppIdAndMachineId(String appId, String machineId);
    boolean isDeploying(String appId, String machineId);
    int countByApp(AppConfig appConfig);

    Page<AppRunning> getAppRunningByPage(String env, String appType, Pageable pageable);
    List<AppRunningNode> getAppRunning(String appId);
}
