package com.lanyuanxiaoyao.service.forest.service;

import com.dtflys.forest.annotation.BaseRequest;
import com.dtflys.forest.annotation.Get;
import com.dtflys.forest.annotation.Query;
import com.lanyuanxiaoyao.service.configuration.entity.flink.*;
import org.eclipse.collections.api.list.ImmutableList;
import org.eclipse.collections.api.map.ImmutableMap;

/**
 * Flink 接口
 *
 * @author lanyuanxiaoyao
 * @date 2023-05-05
 */
@BaseRequest(baseURL = "http://service-flink-query/flink")
public interface FlinkService {
    @Get("/overview")
    FlinkOverview overview(@Query("url") String url);

    @Get("/config")
    FlinkConfig config(@Query("url") String url);

    @Get("/job_manager_config")
    ImmutableList<FlinkKeyValue> jobManagerConfig(@Query("url") String url);

    @Get("/vertex_overview")
    FlinkVertexOverview vertexOverview(@Query("url") String url);

    @Get("/vertex")
    FlinkVertex vertex(@Query("url") String url, @Query("vertex_id") String vertexId);

    @Get("/vertex_config")
    FlinkVertexConfig vertexConfig(@Query("url") String url, @Query("vertex_id") String vertexId);

    @Get("/checkpoint_overview")
    FlinkCheckpointOverview checkpointOverview(@Query("url") String url, @Query("vertex_id") String vertexId);

    @Get("/checkpoint")
    FlinkCheckpoint checkpoint(@Query("url") String url, @Query("vertex_id") String vertexId, @Query("checkpoint_id") Long checkpointId);

    @Get("/checkpoint_config")
    FlinkCheckpointConfig checkpointConfig(@Query("url") String url, @Query("vertex_id") String vertexId);

    @Get("/task_manager_overview")
    FlinkTaskManagerOverview taskManagerOverview(@Query("url") String url);

    @Get("/task_manager")
    FlinkTaskManager taskManager(@Query("url") String url, @Query("task_manager_id") String taskManagerId);
}
