diff --git a/adaptor/PCM-HPC/PCM-AC/rpc/internal/logic/listhistoryjoblogic.go b/adaptor/PCM-HPC/PCM-AC/rpc/internal/logic/listhistoryjoblogic.go index 30b0fa62..048618d7 100644 --- a/adaptor/PCM-HPC/PCM-AC/rpc/internal/logic/listhistoryjoblogic.go +++ b/adaptor/PCM-HPC/PCM-AC/rpc/internal/logic/listhistoryjoblogic.go @@ -5,15 +5,8 @@ import ( "PCM/adaptor/PCM-HPC/PCM-AC/rpc/internal/svc" "PCM/adaptor/PCM-HPC/PCM-AC/rpc/internal/util" "context" - "io" - "log" - "net/http" - "net/url" - "strconv" - "time" - - "github.com/bitly/go-simplejson" "github.com/zeromicro/go-zero/core/logx" + "strconv" ) type ListHistoryJobLogic struct { @@ -30,98 +23,29 @@ func NewListHistoryJobLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Li } } -// ListHistoryJob list all jobs from slurmdb +// ListHistoryJob list all history jobs func (l *ListHistoryJobLogic) ListHistoryJob(in *hpcAC.ListHistoryJobReq) (*hpcAC.ListHistoryJobResp, error) { - - //tokenUrl := l.svcCtx.Config.TokenUrl - //stateUrl = l.svcCtx.Config.StateUrl - //clusterUrl = l.svcCtx.Config.ClusterUrl - var resp hpcAC.ListHistoryJobResp - jobHistoryUrl := "hpc/openapi/v2/historyjobs?" - - ClusterId := util.GetClusterId() - token := util.GetToken() - c := http.Client{Timeout: time.Duration(3) * time.Second} - - params := url.Values{} - params.Add("strClusterNameList", strconv.FormatInt(int64(ClusterId), 10)) - params.Add("startTime", in.StartTime) - params.Add("endTime", in.EndTime) - params.Add("timeType", in.TimeType) //"CUSTOM" - params.Add("start", strconv.FormatInt(int64(in.Start), 10)) - params.Add("limit", strconv.FormatInt(int64(in.Limit), 10)) - params.Add("isQueryByQueueTime", "true") //曙光参数配置问题 - params.Add("strUser", l.svcCtx.Config.ShuguangConf.User) - - reqUrl, err := http.NewRequest("GET", "https://api01.hpccube.com:65106/"+jobHistoryUrl+params.Encode(), nil) - - if err != nil { - log.Fatal(err) - } - - reqUrl.Header.Add("token", token) - - respUrl, err := c.Do(reqUrl) - - if err != nil { - log.Fatal(err) - } - - body, err := io.ReadAll(respUrl.Body) - - jsonResult, err := simplejson.NewJson(body) - jsonData := jsonResult.Get("data") - jobHistoryList := jsonResult.Get("data").Get("list") - rows, err := jobHistoryList.Array() - if err != nil { - log.Fatal(err) - } - defer func(Body io.ReadCloser) { - err := Body.Close() - if err != nil { - - } - }(respUrl.Body) - - var historyJobs []*hpcAC.HistoryJob - - for index := range rows { - jobShuguang := jobHistoryList.GetIndex(index) - var job hpcAC.HistoryJob - - job.JobId, _ = strconv.ParseInt(jobShuguang.Get("jobId").MustString(), 10, 8) - job.JobName = jobShuguang.Get("jobName").MustString() - job.Workdir = jobShuguang.Get("workdir").MustString() - job.Queue = jobShuguang.Get("queue").MustString() - job.JobExecHost = jobShuguang.Get("jobExecHost").MustString() - job.JobExitStatus = int32(jobShuguang.Get("jobExitStatus").MustInt()) - job.UserName = jobShuguang.Get("userName").MustString() - job.AcctTime = jobShuguang.Get("accTime").MustString() - job.AppType = jobShuguang.Get("appType").MustString() - job.JobQueueTime = jobShuguang.Get("jobQueueTime").MustString() - job.JobWalltimeUsed = jobShuguang.Get("jobWalltimeUsed").MustString() - job.JobManagerId = jobShuguang.Get("jobmanagerId").MustInt64() - job.JobState = jobShuguang.Get("jobState").MustString() - job.NodeCt = int32(jobShuguang.Get("nodect").MustInt64()) - - startTime, err := time.Parse(l.svcCtx.Config.ShuguangConf.Layout, jobShuguang.Get("jobStartTime").MustString()) - if err == nil { - job.JobStartTime = startTime.String() - } - endTime, err := time.Parse(l.svcCtx.Config.ShuguangConf.Layout, jobShuguang.Get("jobEndTime").MustString()) - if err == nil { - job.JobEndTime = endTime.String() - } - historyJobs = append(historyJobs, &job) - - } - - if jsonResult.Get("code").MustInt() == 0 { - resp.Code = uint32(200) + url := "hpc/openapi/v2/historyjobs" + resp := hpcAC.ListHistoryJobResp{} + params := map[string]string{ + "strClusterNameList": in.StrClusterNameList, + "startTime": in.StartTime, + "endTime": in.EndTime, + "timeType": in.TimeType, + "queue": in.Queue, + "appType": in.AppType, + "sort": in.Sort, + "orderBy": in.OrderBy, + "jobId": in.JobId, + "jobState": in.JobState, + "hostName": in.HostName, + "strUser": in.StrUser, + "jobName": in.JobName, + "start": strconv.Itoa(int(in.Start)), + "limit": strconv.Itoa(int(in.Limit)), + "isQueryByQueueTime": in.IsQueryByQueueTime, } - resp.Msg = jsonResult.Get("msg").MustString() - resp.RecordCount = uint32(jsonData.Get("total").MustInt()) - resp.HistoryJobs = historyJobs + _, _ = util.Get(&l.ctx, url, nil, ¶ms, &resp) return &resp, nil } diff --git a/adaptor/PCM-HPC/PCM-AC/rpc/internal/util/client.go b/adaptor/PCM-HPC/PCM-AC/rpc/internal/util/client.go index 0bf904ca..f6090703 100644 --- a/adaptor/PCM-HPC/PCM-AC/rpc/internal/util/client.go +++ b/adaptor/PCM-HPC/PCM-AC/rpc/internal/util/client.go @@ -6,6 +6,7 @@ import ( "PCM/common/tool/httpclient" "context" "errors" + "github.com/go-resty/resty/v2" "github.com/zeromicro/go-zero/core/conf" "github.com/zeromicro/go-zero/core/logx" "runtime" diff --git a/adaptor/PCM-HPC/PCM-AC/rpc/pb/hpcAC.proto b/adaptor/PCM-HPC/PCM-AC/rpc/pb/hpcAC.proto index 7e375b55..cbadb1a2 100644 --- a/adaptor/PCM-HPC/PCM-AC/rpc/pb/hpcAC.proto +++ b/adaptor/PCM-HPC/PCM-AC/rpc/pb/hpcAC.proto @@ -24,150 +24,150 @@ message ListJobManagerResp{ /******************Job Detail Start*************************/ message JobInitAttr { - string account = 1; // @gotags: copier:"Account", json:"Account" - string accrue_time = 2; // @gotags: copier:"AccrueTime", json:"AccrueTime" - string alloc_node_sid = 3; // @gotags: copier:"AllocNode:Sid", json:"AllocNode:Sid" - string batch_flag = 4; // @gotags: copier:"BatchFlag", json:"BatchFlag" - string cpus_task = 5; // @gotags: copier:"CPUs/Task", json:"CPUs/Task" - string command = 6; // @gotags: copier:"Command", json:"Command" - string command_exist = 7; // @gotags: copier:"CommandExist", json:"CommandExist" - string comment = 8; // @gotags: copier:"Comment", json:"Comment" - string contiguous = 9; // @gotags: copier:"Contiguous", json:"Contiguous" - string core_spec = 10; // @gotags: copier:"CoreSpec", json:"CoreSpec" - string deadline = 11; // @gotags: copier:"Deadline", json:"Deadline" - string delay_boot = 12; // @gotags: copier:"DelayBoot", json:"DelayBoot" - string dependency = 13; // @gotags: copier:"Dependency", json:"Dependency" - string eligible_time = 14; // @gotags: copier:"EligibleTime", json:"EligibleTime" - string end_time = 15; // @gotags: copier:"EndTime", json:"EndTime" - string exc_node_list = 16; // @gotags: copier:"ExcNodeList", json:"ExcNodeList" - string exit_code = 17; // @gotags: copier:"ExitCode", json:"ExitCode" - string features = 18; // @gotags: copier:"Features", json:"Features" - string group_id = 19; // @gotags: copier:"GroupId", json:"GroupId" - string job_id = 20; // @gotags: copier:"JobId", json:"JobId" - string job_name = 21; // @gotags: copier:"JobName", json:"JobName" - string job_state = 22; // @gotags: copier:"JobState", json:"JobState" - string licenses = 23; // @gotags: copier:"Licenses", json:"Licenses" - string mcs_label = 24; // @gotags: copier:"MCS_label", json:"MCS_label" - string min_cpus_node = 25; // @gotags: copier:"MinCPUsNode", json:"MinCPUsNode" - string min_tmp_disk_node = 26; // @gotags: copier:"MinTmpDiskNode", json:"MinTmpDiskNode" - string network = 27; // @gotags: copier:"Network", json:"Network" - string nice = 28; // @gotags: copier:"Nice", json:"Nice" - string node_list = 29; // @gotags: copier:"NodeList", json:"NodeList" - string ntasks_per_nbsc = 30; // @gotags: copier:"NtasksPerN:B:S:C", json:"NtasksPerN:B:S:C" - string num_cpus = 31; // @gotags: copier:"NumCPUs", json:"NumCPUs" - string num_nodes = 32; // @gotags: copier:"NumNodes", json:"NumNodes" - string num_tasks = 33; // @gotags: copier:"NumTasks", json:"NumTasks" - string over_subscribe = 34; // @gotags: copier:"OverSubscribe", json:"OverSubscribe" - string partition = 35; // @gotags: copier:"Partition", json:"Partition" - string power = 36; // @gotags: copier:"Power", json:"Power" - string priority = 37; // @gotags: copier:"Priority", json:"Priority" - string qos = 38; // @gotags: copier:"QOS", json:"QOS" - string reason = 39; // @gotags: copier:"Reason", json:"Reason" - string reboot = 40; // @gotags: copier:"Reboot", json:"Reboot" - string req_bsct = 41; // @gotags: copier:"ReqB:S:C:T", json:"ReqB:S:C:T" - string ReqNodeList = 42; // @gotags: copier:"ReqNodeList", json:"ReqNodeList" - string requeue = 43; // @gotags: copier:"Requeue", json:"Requeue" - string restarts = 44; // @gotags: copier:"Restarts", json:"Restarts" - string run_time = 45; // @gotags: copier:"RunTime", json:"RunTime" - string batch_host = 46; // @gotags: copier:"BatchHost", json:"BatchHost" - string secs_pre_suspend = 47; // @gotags: copier:"SecsPreSuspend", json:"SecsPreSuspend" - string socks_node = 48; // @gotags: copier:"Socks/Node", json:"Socks/Node" - string start_time = 49; // @gotags: copier:"StartTime", json:"StartTime" - string std_err = 50; // @gotags: copier:"StdErr", json:"StdErr" - string std_in = 51; // @gotags: copier:"StdIn", json:"StdIn" - string std_out = 52; // @gotags: copier:"StdOut", json:"StdOut" - string submit_time = 53; // @gotags: copier:"SubmitTime", json:"SubmitTime" - string suspend_time = 54; // @gotags: copier:"SuspendTime", json:"SuspendTime" - string tres = 55; // @gotags: copier:"TRES", json:"TRES" - string time_limit = 56; // @gotags: copier:"TimeLimit", json:"TimeLimit" - string time_min = 57; // @gotags: copier:"TimeMin", json:"TimeMin" - string user_id = 58; // @gotags: copier:"UserId", json:"UserId" - string work_dir = 59; // @gotags: copier:"WorkDir", json:"WorkDir" + string account = 1; // @gotags: copier:"Account", json:"Account" + string accrue_time = 2; // @gotags: copier:"AccrueTime", json:"AccrueTime" + string alloc_node_sid = 3; // @gotags: copier:"AllocNode:Sid", json:"AllocNode:Sid" + string batch_flag = 4; // @gotags: copier:"BatchFlag", json:"BatchFlag" + string cpus_task = 5; // @gotags: copier:"CPUs/Task", json:"CPUs/Task" + string command = 6; // @gotags: copier:"Command", json:"Command" + string command_exist = 7; // @gotags: copier:"CommandExist", json:"CommandExist" + string comment = 8; // @gotags: copier:"Comment", json:"Comment" + string contiguous = 9; // @gotags: copier:"Contiguous", json:"Contiguous" + string core_spec = 10; // @gotags: copier:"CoreSpec", json:"CoreSpec" + string deadline = 11; // @gotags: copier:"Deadline", json:"Deadline" + string delay_boot = 12; // @gotags: copier:"DelayBoot", json:"DelayBoot" + string dependency = 13; // @gotags: copier:"Dependency", json:"Dependency" + string eligible_time = 14; // @gotags: copier:"EligibleTime", json:"EligibleTime" + string end_time = 15; // @gotags: copier:"EndTime", json:"EndTime" + string exc_node_list = 16; // @gotags: copier:"ExcNodeList", json:"ExcNodeList" + string exit_code = 17; // @gotags: copier:"ExitCode", json:"ExitCode" + string features = 18; // @gotags: copier:"Features", json:"Features" + string group_id = 19; // @gotags: copier:"GroupId", json:"GroupId" + string job_id = 20; // @gotags: copier:"JobId", json:"JobId" + string job_name = 21; // @gotags: copier:"JobName", json:"JobName" + string job_state = 22; // @gotags: copier:"JobState", json:"JobState" + string licenses = 23; // @gotags: copier:"Licenses", json:"Licenses" + string mcs_label = 24; // @gotags: copier:"MCS_label", json:"MCS_label" + string min_cpus_node = 25; // @gotags: copier:"MinCPUsNode", json:"MinCPUsNode" + string min_tmp_disk_node = 26; // @gotags: copier:"MinTmpDiskNode", json:"MinTmpDiskNode" + string network = 27; // @gotags: copier:"Network", json:"Network" + string nice = 28; // @gotags: copier:"Nice", json:"Nice" + string node_list = 29; // @gotags: copier:"NodeList", json:"NodeList" + string ntasks_per_nbsc = 30; // @gotags: copier:"NtasksPerN:B:S:C", json:"NtasksPerN:B:S:C" + string num_cpus = 31; // @gotags: copier:"NumCPUs", json:"NumCPUs" + string num_nodes = 32; // @gotags: copier:"NumNodes", json:"NumNodes" + string num_tasks = 33; // @gotags: copier:"NumTasks", json:"NumTasks" + string over_subscribe = 34; // @gotags: copier:"OverSubscribe", json:"OverSubscribe" + string partition = 35; // @gotags: copier:"Partition", json:"Partition" + string power = 36; // @gotags: copier:"Power", json:"Power" + string priority = 37; // @gotags: copier:"Priority", json:"Priority" + string qos = 38; // @gotags: copier:"QOS", json:"QOS" + string reason = 39; // @gotags: copier:"Reason", json:"Reason" + string reboot = 40; // @gotags: copier:"Reboot", json:"Reboot" + string req_bsct = 41; // @gotags: copier:"ReqB:S:C:T", json:"ReqB:S:C:T" + string ReqNodeList = 42; // @gotags: copier:"ReqNodeList", json:"ReqNodeList" + string requeue = 43; // @gotags: copier:"Requeue", json:"Requeue" + string restarts = 44; // @gotags: copier:"Restarts", json:"Restarts" + string run_time = 45; // @gotags: copier:"RunTime", json:"RunTime" + string batch_host = 46; // @gotags: copier:"BatchHost", json:"BatchHost" + string secs_pre_suspend = 47; // @gotags: copier:"SecsPreSuspend", json:"SecsPreSuspend" + string socks_node = 48; // @gotags: copier:"Socks/Node", json:"Socks/Node" + string start_time = 49; // @gotags: copier:"StartTime", json:"StartTime" + string std_err = 50; // @gotags: copier:"StdErr", json:"StdErr" + string std_in = 51; // @gotags: copier:"StdIn", json:"StdIn" + string std_out = 52; // @gotags: copier:"StdOut", json:"StdOut" + string submit_time = 53; // @gotags: copier:"SubmitTime", json:"SubmitTime" + string suspend_time = 54; // @gotags: copier:"SuspendTime", json:"SuspendTime" + string tres = 55; // @gotags: copier:"TRES", json:"TRES" + string time_limit = 56; // @gotags: copier:"TimeLimit", json:"TimeLimit" + string time_min = 57; // @gotags: copier:"TimeMin", json:"TimeMin" + string user_id = 58; // @gotags: copier:"UserId", json:"UserId" + string work_dir = 59; // @gotags: copier:"WorkDir", json:"WorkDir" } message JobVncSessionInfo { - string archive = 1; // @gotags: copier:"archive", json:"archive" - uint32 i_client_number = 2; // @gotags: copier:"iClientNumber", json:"iClientNumber" - string i_pixel_depth = 3; // @gotags: copier:"iPixelDepth", json:"iPixelDepth" - string list_clients = 4; // @gotags: copier:"listClients", json:"listClients" - string locale = 5; // @gotags: copier:"locale", json:"locale" - string loginPasswd = 6; // @gotags: copier:"loginPasswd", json:"loginPasswd" - string map_session_extra_attrs = 7; // @gotags: copier:"mapSessionExtraAttrs", json:"mapSessionExtraAttrs" - string str_auth_type = 8; // @gotags: copier:"strAuthType", json:"strAuthType" - string str_geometry = 9; // @gotags: copier:"strGeometry", json:"strGeometry" - string str_job_manager_addr = 10; // @gotags: copier:"strJobManagerAddr", json:"strJobManagerAddr" - string str_job_manager_id = 11; // @gotags: copier:"strJobManagerID", json:"strJobManagerID" - string str_job_manager_name = 12; // @gotags: copier:"strJobManagerName", json:"strJobManagerName" - string str_relate_job_id = 13; // @gotags: copier:"strRelateJobID", json:"strRelateJobID" - string str_server_addr = 14; // @gotags: copier:"strServerAddr", json:"strServerAddr" - string str_server_name = 15; // @gotags: copier:"strServerName", json:"strServerName" - string str_session_ctime = 16; // @gotags: copier:"strSessionCTime", json:"strSessionCTime" - string str_session_height = 17; // @gotags: copier:"strSessionHeight", json:"strSessionHeight" - string str_session_id = 18; // @gotags: copier:"strSessionID", json:"strSessionID" - string str_session_owner = 19; // @gotags: copier:"strSessionOwner", json:"strSessionOwner" - string str_session_type = 20; // @gotags: copier:"strSessionType", json:"strSessionType" - string str_session_width = 21; // @gotags: copier:"strSessionWidth", json:"strSessionWidth" - string vnc_code = 22; // @gotags: copier:"vncCode", json:"vncCode" + string archive = 1; // @gotags: copier:"archive", json:"archive" + uint32 i_client_number = 2; // @gotags: copier:"iClientNumber", json:"iClientNumber" + string i_pixel_depth = 3; // @gotags: copier:"iPixelDepth", json:"iPixelDepth" + string list_clients = 4; // @gotags: copier:"listClients", json:"listClients" + string locale = 5; // @gotags: copier:"locale", json:"locale" + string loginPasswd = 6; // @gotags: copier:"loginPasswd", json:"loginPasswd" + string map_session_extra_attrs = 7; // @gotags: copier:"mapSessionExtraAttrs", json:"mapSessionExtraAttrs" + string str_auth_type = 8; // @gotags: copier:"strAuthType", json:"strAuthType" + string str_geometry = 9; // @gotags: copier:"strGeometry", json:"strGeometry" + string str_job_manager_addr = 10; // @gotags: copier:"strJobManagerAddr", json:"strJobManagerAddr" + string str_job_manager_id = 11; // @gotags: copier:"strJobManagerID", json:"strJobManagerID" + string str_job_manager_name = 12; // @gotags: copier:"strJobManagerName", json:"strJobManagerName" + string str_relate_job_id = 13; // @gotags: copier:"strRelateJobID", json:"strRelateJobID" + string str_server_addr = 14; // @gotags: copier:"strServerAddr", json:"strServerAddr" + string str_server_name = 15; // @gotags: copier:"strServerName", json:"strServerName" + string str_session_ctime = 16; // @gotags: copier:"strSessionCTime", json:"strSessionCTime" + string str_session_height = 17; // @gotags: copier:"strSessionHeight", json:"strSessionHeight" + string str_session_id = 18; // @gotags: copier:"strSessionID", json:"strSessionID" + string str_session_owner = 19; // @gotags: copier:"strSessionOwner", json:"strSessionOwner" + string str_session_type = 20; // @gotags: copier:"strSessionType", json:"strSessionType" + string str_session_width = 21; // @gotags: copier:"strSessionWidth", json:"strSessionWidth" + string vnc_code = 22; // @gotags: copier:"vncCode", json:"vncCode" } message JobDetail{ - string app_type = 1; // @gotags: copier:"AppType", json:"appType" - string ave_rss = 2; // @gotags: copier:"AveRSS", json:"aveRSS" - string ave_vm_size = 3; // @gotags: copier:"AveVMSize", json:"aveVMSize" - string cpu_time_used = 4; // @gotags: copier:"CpuTimeUsed", json:"cpuTimeUsed" - uint32 dcu_num_req = 5; // @gotags: copier:"DcuNumReq", json:"dcuNumReq" - uint32 dcu_num_used = 6; // @gotags: copier:"DcuNumUsed", json:"dcuNumUsed" - string error_path = 7; // @gotags: copier:"ErrorPath", json:"errorPath" - string exit_code = 8; // @gotags: copier:"ExitCode", json:"exitCode" - uint32 gpu_num_req = 9; // @gotags: copier:"GpuNumReq", json:"gpuNumReq" - uint32 gpu_num_used = 10; // @gotags: copier:"GpuNumUsed", json:"gpuNumUsed" - string job_end_time = 11; // @gotags: copier:"JobEndTime", json:"jobEndTime" - string job_id = 12; // @gotags: copier:"JobId", json:"jobId" - JobInitAttr job_init_attr = 13; // @gotags: copier:"JobInitAttr", json:"JobInitAttr" - string job_name = 14; // @gotags: copier:"JobName", json:"jobName" - string job_run_time = 15; // @gotags: copier:"JobRunTime", json:"jobRunTime" - string job_start_time = 16; // @gotags: copier:"JobStartTime", json:"jobStartTime" - string job_status = 17; // @gotags: copier:"JobStatus", json:"jobStatus" - string job_submit_time = 18; // @gotags: copier:"JobSubmitTime", json:"jobSubmitTime" - JobVncSessionInfo job_session_info = 19; // @gotags: copier:"JobVncSessionInfo", json:"jobVncSessionInfo" - string job_manager_id = 20; // @gotags: copier:"JobManagerId", json:"jobmanagerId" - string job_manager_name = 21; // @gotags: copier:"JobManagerName", json:"jobmanagerName" - string job_manager_type = 22; // @gotags: copier:"JobManagerType", json:"jobmanagerType" - string mem_used = 23; // @gotags: copier:"MemUsed", json:"memUsed" - uint32 node_num_req = 24; // @gotags: copier:"NodeNumReq", json:"nodeNumReq" - string node_used = 25; // @gotags: copier:"NodeUsed", json:"nodeUsed" - string output_path = 26; // @gotags: copier:"OutputPath", json:"outputPath" - string priority = 27; // @gotags: copier:"Priority", json:"priority" - uint32 proc_num_req = 28; // @gotags: copier:"ProcNumReq", json:"procNumReq" - uint32 proc_num_used = 29; // @gotags: copier:"procNumUsed", json:"procNumUsed" - string queue = 30; // @gotags: copier:"Queue", json:"queue" - string restarts = 31; // @gotags: copier:"Restarts", json:"restarts" - string scale = 32; // @gotags: copier:"Scale", json:"scale" - string user = 33; // @gotags: copier:"User", json:"user" - string walltime_req = 34; // @gotags: copier:"WalltimeReq", json:"walltimeReq" - string work_dir = 35; // @gotags: copier:"WorkDir", json:"workDir" + string app_type = 1; // @gotags: copier:"AppType", json:"appType" + string ave_rss = 2; // @gotags: copier:"AveRSS", json:"aveRSS" + string ave_vm_size = 3; // @gotags: copier:"AveVMSize", json:"aveVMSize" + string cpu_time_used = 4; // @gotags: copier:"CpuTimeUsed", json:"cpuTimeUsed" + uint32 dcu_num_req = 5; // @gotags: copier:"DcuNumReq", json:"dcuNumReq" + uint32 dcu_num_used = 6; // @gotags: copier:"DcuNumUsed", json:"dcuNumUsed" + string error_path = 7; // @gotags: copier:"ErrorPath", json:"errorPath" + string exit_code = 8; // @gotags: copier:"ExitCode", json:"exitCode" + uint32 gpu_num_req = 9; // @gotags: copier:"GpuNumReq", json:"gpuNumReq" + uint32 gpu_num_used = 10; // @gotags: copier:"GpuNumUsed", json:"gpuNumUsed" + string job_end_time = 11; // @gotags: copier:"JobEndTime", json:"jobEndTime" + string job_id = 12; // @gotags: copier:"JobId", json:"jobId" + JobInitAttr job_init_attr = 13; // @gotags: copier:"JobInitAttr", json:"JobInitAttr" + string job_name = 14; // @gotags: copier:"JobName", json:"jobName" + string job_run_time = 15; // @gotags: copier:"JobRunTime", json:"jobRunTime" + string job_start_time = 16; // @gotags: copier:"JobStartTime", json:"jobStartTime" + string job_status = 17; // @gotags: copier:"JobStatus", json:"jobStatus" + string job_submit_time = 18; // @gotags: copier:"JobSubmitTime", json:"jobSubmitTime" + JobVncSessionInfo job_session_info = 19; // @gotags: copier:"JobVncSessionInfo", json:"jobVncSessionInfo" + string job_manager_id = 20; // @gotags: copier:"JobManagerId", json:"jobmanagerId" + string job_manager_name = 21; // @gotags: copier:"JobManagerName", json:"jobmanagerName" + string job_manager_type = 22; // @gotags: copier:"JobManagerType", json:"jobmanagerType" + string mem_used = 23; // @gotags: copier:"MemUsed", json:"memUsed" + uint32 node_num_req = 24; // @gotags: copier:"NodeNumReq", json:"nodeNumReq" + string node_used = 25; // @gotags: copier:"NodeUsed", json:"nodeUsed" + string output_path = 26; // @gotags: copier:"OutputPath", json:"outputPath" + string priority = 27; // @gotags: copier:"Priority", json:"priority" + uint32 proc_num_req = 28; // @gotags: copier:"ProcNumReq", json:"procNumReq" + uint32 proc_num_used = 29; // @gotags: copier:"procNumUsed", json:"procNumUsed" + string queue = 30; // @gotags: copier:"Queue", json:"queue" + string restarts = 31; // @gotags: copier:"Restarts", json:"restarts" + string scale = 32; // @gotags: copier:"Scale", json:"scale" + string user = 33; // @gotags: copier:"User", json:"user" + string walltime_req = 34; // @gotags: copier:"WalltimeReq", json:"walltimeReq" + string work_dir = 35; // @gotags: copier:"WorkDir", json:"workDir" } message JobDetailReq{ - string job_id =1; // @gotags: copier:"JobId", json:"jobId" + string job_id = 1; // @gotags: copier:"JobId", json:"jobId" } message GetJobDetailResp{ - string code = 1; // @gotags: copier:"Code", json:"code" - string msg = 2; // @gotags: copier:"Msg", json:"msg" - JobDetail data = 3; // @gotags: copier:"JobDetail", json:"data" + string code = 1; // @gotags: copier:"Code", json:"code" + string msg = 2; // @gotags: copier:"Msg", json:"msg" + JobDetail data = 3; // @gotags: copier:"JobDetail", json:"data" } /******************Job Detail End*************************/ /******************Job(Delete) Start*************************/ message DeleteJobReq{ - string str_job_info_map = 1; // @gotags: copier:"strJobInfoMap", json:"strJobInfoMap" + string str_job_info_map = 1; // @gotags: copier:"strJobInfoMap", json:"strJobInfoMap" } message DeleteJobResp{ - string code = 1; // @gotags: copier:"Code", json:"code" - string msg = 2; // @gotags: copier:"Msg", json:"msg" - map data = 3; // @gotags: copier:"Result", json:"data" + string code = 1; // @gotags: copier:"Code", json:"code" + string msg = 2; // @gotags: copier:"Msg", json:"msg" + map data = 3; // @gotags: copier:"Result", json:"data" } /******************Job(Delete) End*************************/ @@ -205,39 +205,55 @@ message ListJobResp{ /******************History Job Start*************************/ -message historyJob{ - string acct_time = 1; // @gotags: copier:"AcctTime" - string app_type = 2; // @gotags: copier:"AppType" - string job_end_time = 3; // @gotags: copier:"End" - string job_exec_host = 4; // @gotags: copier:"Nodes" - int32 job_exit_status = 5; // @gotags: copier:"ExitCode" - int64 job_id = 6; // @gotags: copier:"JobId" - string job_name = 7; // @gotags: copier:"JobName" - string job_queue_time = 8; // @gotags: copier:"JobQueueTime" - string job_start_time = 9; // @gotags: copier:"Start" - string job_state = 10; // @gotags: copier:"State" - string job_walltime_used = 11; // @gotags: copier:"JobWalltimeUsed" - int64 job_manager_id = 12; // @gotags: copier:"JobManagerId" - int32 node_ct = 13; // @gotags: copier:"AllocNodes" - string queue = 14; // @gotags: copier:"Partition" - string user_name = 15; // @gotags: copier:"User" - string workdir = 16; // @gotags: copier:"WorkDir" -} message ListHistoryJobReq{ - string startTime = 1;// @gotags: copier:"StartTime" - string endTime = 2;// @gotags: copier:"EndTime" - string timeType = 3;// @gotags: copier:"TimeType" - int32 start = 4;// @gotags: copier:"Start" - int32 limit = 5;// @gotags: copier:"Limit" - int32 isQueryByQueueTime = 6;// @gotags: copier:"IsQueryByQueueTime" + string strClusterNameList = 1; // @gotags: copier:"StrClusterNameList" //调度器ID 示例:1638523853 + string startTime = 2; // @gotags: copier:"StartTime" //开始时间 示例:2021-11-23 01:01:01 + string endTime = 3; // @gotags: copier:"EndTime" //结束时间 示例:2021-12-23 01:01:01 + string timeType = 4; // @gotags: copier:"TimeType" //CUSTOM 示例:CUSTOM + string queue = 5; // @gotags: copier:"Queue" //队列名称 示例:debug + string appType = 6; // @gotags: copier:"AppType" //应用名称 示例:fluent + string sort = 7; // @gotags: copier:"Sort" //排序规则 示例:DESC/ASC + string orderBy = 8; // @gotags: copier:"OrderBy" //排序字段 示例:jobId + string jobId = 9; // @gotags: copier:"JobId" //作业ID 示例:12 + string jobState = 10; // @gotags: copier:"JobState" //'statR(运行)','statQ(排队)','statH(保留)','statS(挂起)','statE(退出)','statC(完成)','statW(等待)','statX(其他)' 示例:statQ + string hostName = 11; // @gotags: copier:"HostName" //节点名称 示例:h04r3n07 + string strUser = 12; // @gotags: copier:"StrUser" //用户名称 示例:test + string jobName = 13; // @gotags: copier:"JobName" //作业名称 示例:STDIN_1208_173644 + int32 start = 14; // @gotags: copier:"Start" //起始坐标 示例:0 + int32 limit = 15; // @gotags: copier:"Limit" //请求一次获取数据的数目 示例:25 + string isQueryByQueueTime = 16; // @gotags: copier:"IsQueryByQueueTime" //按照结束时间查询false/按照入队时间查询true(推荐false) 示例:false } message ListHistoryJobResp{ - uint32 code = 1; // @gotags: copier:"Code" + string code = 1; // @gotags: copier:"Code" string msg = 2; // @gotags: copier:"Msg" - uint32 record_count = 3; // @gotags: copier:"RecordCount" - repeated historyJob history_jobs = 4; // @gotags: copier:"HistoryJobs" + HistoryJobData data = 4; // @gotags: copier:"Data" +} + +message HistoryJobData { + int32 total = 1; // @gotags: copier:"Total" + repeated HistoryJobList list = 2; // @gotags: copier:"List" +} + +message HistoryJobList { + string acctTime = 1; // @gotags: copier:"AcctTime" //记账时间 示例:2021-11-04 18:07:12 + string jobId = 2; // @gotags: copier:"JobId" //作业id 示例:12 + int32 jobmanagerId = 3; // @gotags: copier:"JobmanagerId" //区域id 示例:1638523853 + string userName = 4; // @gotags: copier:"UserName" //用户名 示例:haowj + string jobName = 5; // @gotags: copier:"JobName" //作业名 示例:FLUENT_1104_181054 + string queue = 6; // @gotags: copier:"Queue" //队列名 示例:debug + string jobQueueTime = 7; // @gotags: copier:"JobQueueTime" //作业入队列时间 示例:2021-11-04 17:57:34 + string jobStartTime = 8; // @gotags: copier:"JobStartTime" //作业启动时间 示例:2021-11-04 17:57:34 + string jobExecHost = 9; // @gotags: copier:"JobExecHost" //作业执行节点 示例:gv35New248 + int32 nodect = 10; // @gotags: copier:"Nodect" //分配的节点数 示例:1 + string jobEndTime = 11; // @gotags: copier:"JobEndTime" //作业结束时间 示例:2021-11-04 18:07:12 + string jobWalltimeUsed = 12; // @gotags: copier:"JobWalltimeUsed" //作业实际使用的Walltime,单位为秒 示例:0.1606 + string workdir = 13; // @gotags: copier:"Workdir" //工作空间 示例:/public/home/haowj/00-HPC-CASE/FLUENT_1027_105403 + string appType = 14; // @gotags: copier:"AppType" //作业应用类型 示例:FLUENT + string jobState = 15; // @gotags: copier:"JobState" //作业状态 示例:statC + int32 jobExitStatus = 16; // @gotags: copier:"JobExitStatus" //作业退出码 示例:0 + int32 jobProcNum = 17; // @gotags: copier:"JobProcNum" //作业CPU核数 示例:1 } /******************History Job End*************************/ @@ -427,7 +443,7 @@ message HistoryJobDetail { message HistoryJobDetailResp { string code = 1; string msg = 2; - HistoryJobDetail data =3; + HistoryJobDetail data = 3; } message FileContentResp{