package com.lanyuanxiaoyao.service.forest.service;

import com.dtflys.forest.annotation.Get;
import com.dtflys.forest.annotation.Query;
import com.lanyuanxiaoyao.service.configuration.entity.yarn.YarnApplication;
import com.lanyuanxiaoyao.service.configuration.entity.yarn.YarnQueue;
import com.lanyuanxiaoyao.service.configuration.entity.yarn.YarnRootQueue;
import org.eclipse.collections.api.list.ImmutableList;

/**
 * @author lanyuanxiaoyao
 * @date 2023-04-23
 */
public interface YarnService {
    @Get("/job/list")
    ImmutableList<YarnApplication> jobList();

    @Get("/job/list")
    ImmutableList<YarnApplication> jobListEquals(@Query("name") String name);

    @Get("/job/list")
    ImmutableList<YarnApplication> jobListLike(@Query("text") String text);

    @Get("/job/kill")
    void jobKill(@Query("application_id") String applicationId);

    @Get("/job/detail")
    YarnApplication jobDetail(@Query("application_id") String applicationId);

    @Get("/queue/list")
    ImmutableList<YarnQueue> queueList();

    @Get("/queue/detail")
    YarnQueue queueDetail(@Query("name") String name);

    @Get("/cluster/info")
    YarnRootQueue cluster();
}
