package com.microservices.mon.k8s.service;

import com.alibaba.fastjson2.JSONObject;
import com.microservices.common.core.web.page.GenericsTableDataInfo;
import com.microservices.mon.k8s.domain.*;
import com.microservices.mon.k8s.domain.vo.ApplicationEnvTypeVo;
import com.microservices.mon.k8s.domain.vo.ApplicationTypeVo;
import com.microservices.mon.k8s.domain.vo.CommonTypeVo;

import java.util.Date;
import java.util.List;

public interface IMicroManagementService {
    List<K8sApplicationPod> getPodList();

    K8sPodContainerMetricOverview getPodStatus(String podName, Long step);

    K8sApplication getApplicationDetail(String kind, String namespace, String applicationName);

    Boolean deletePod(String namespace, String podName, Boolean isForce);

    List<K8sApplicationPod> getK8sApplicationPodList(K8sApplication k8sApplication);

    Boolean operateApplication(String kind, String namespace, String applicationName, String operationKey);

    List<ApplicationTypeVo> getApplicationTypeList();

    String createApplication(String kind, String yamlContent);

    JSONObject getApplicationYamlFile(String kind, String namespace, String applicationName);

    Boolean editApplication(String kind, String namespace, String applicationName, String yamlContent);

    Boolean deleteApplication(String kind, String namespace, String applicationName);

    List<K8sApplicationEnv> getApplicationEnv(String kind, String namespace, String applicationName);

    List<K8sApplicationEnvOptionalParameter> getEnvOptionalParameters(String namespace);

    Boolean updateApplicationEnv(String kind, String namespace, String applicationName, List<K8sApplicationEnv> k8sApplicationEnvList);

    List<ApplicationEnvTypeVo> getEnvTypes();

    List<GatewayRouteConfig> getGatewayRouteConfig();

    GatewaySafetyConfig getGatewaySafetyConfig();

    GatewayWhitelistConfig getGatewayWhitelistConfig();

    Boolean updateGatewayRouteConfig(List<GatewayRouteConfig> gatewayRouteConfigList);

    Boolean updateGatewaySafetyConfig(GatewaySafetyConfig gatewaySafetyConfig);

    Boolean updateGatewayWhitelistConfig(GatewayWhitelistConfig gatewayWhitelistConfig);

    List<String> getExceptionHandingDateList();

    List<String> getExceptionHandingRecordList(String date);

    List<LinkTrackingApplication> getLinkTrackingList(String applicationName);

    JSONObject getGatewayFlowLimitingPara();

    GenericsTableDataInfo<K8SEvent> getK8SEventList(String eventType, String reason, Date startTime, Date endTime, Boolean isAscOrderByOccurredTime, Integer pageNum, Integer pageSize);

    List<K8SResourceUsage> getResourceUsageList(String resourceObject, Date startTime, Date endTime);

    List<CommonTypeVo> getK8SEventReasonList(String eventType);

    List<CommonTypeVo> getResourceObjectList();
}
