| @@ -1,7 +1,7 @@ | |||
| // Code generated by protoc-gen-go-grpc. DO NOT EDIT. | |||
| // versions: | |||
| // - protoc-gen-go-grpc v1.2.0 | |||
| // - protoc v3.21.12 | |||
| // - protoc v3.19.4 | |||
| // source: hpcAC.proto | |||
| package hpcAC | |||
| @@ -30,12 +30,10 @@ type HpcACClient interface { | |||
| SubmitJob(ctx context.Context, in *SubmitJobReq, opts ...grpc.CallOption) (*SubmitJobResp, error) | |||
| // ListJobManager list all job managers | |||
| ListJobManager(ctx context.Context, in *JobManagerReq, opts ...grpc.CallOption) (*ListJobManagerResp, error) | |||
| <<<<<<< HEAD | |||
| // GetJobDetail get job detail | |||
| GetJobDetail(ctx context.Context, in *JobDetailReq, opts ...grpc.CallOption) (*GetJobDetailResp, error) | |||
| // DeleteJob delete job | |||
| DeleteJob(ctx context.Context, in *DeleteJobReq, opts ...grpc.CallOption) (*DeleteJobResp, error) | |||
| ======= | |||
| // FileContent 查看文件内容 | |||
| FileContent(ctx context.Context, in *FileDataReq, opts ...grpc.CallOption) (*FileContentResp, error) | |||
| // SelectQueueByUser 查询用户可访问队列列表 | |||
| @@ -44,7 +42,15 @@ type HpcACClient interface { | |||
| QueryQueueDetails(ctx context.Context, in *QueueReq, opts ...grpc.CallOption) (*QueueDetailsResp, error) | |||
| // /QueryUserQuotasLimit 查询用户资源限制信息 | |||
| QueryUserQuotasLimit(ctx context.Context, in *QueueReq, opts ...grpc.CallOption) (*UserQuotasLimitResp, error) | |||
| >>>>>>> ff7628a455a0eb264866e5bde762cd1c671eb8f3 | |||
| // ParaStor Quota | |||
| ParaStorQuota(ctx context.Context, in *ParaStorQuotaReq, opts ...grpc.CallOption) (*ParaStorQuotaResp, error) | |||
| // WallTime | |||
| WallTime(ctx context.Context, in *WallTimeReq, opts ...grpc.CallOption) (*WallTimeResp, error) | |||
| // QueueJobs | |||
| QueueJobs(ctx context.Context, in *QueueJobsReq, opts ...grpc.CallOption) (*QueueJobsResp, error) | |||
| CpuCore(ctx context.Context, in *CpuCoreReq, opts ...grpc.CallOption) (*CpuCoreResp, error) | |||
| Jobs(ctx context.Context, in *JobsReq, opts ...grpc.CallOption) (*JobsResp, error) | |||
| HistoryJobDetail(ctx context.Context, in *HistoryJobDetailReq, opts ...grpc.CallOption) (*HistoryJobDetailResp, error) | |||
| } | |||
| type hpcACClient struct { | |||
| @@ -91,26 +97,33 @@ func (c *hpcACClient) ListJobManager(ctx context.Context, in *JobManagerReq, opt | |||
| return out, nil | |||
| } | |||
| <<<<<<< HEAD | |||
| func (c *hpcACClient) GetJobDetail(ctx context.Context, in *JobDetailReq, opts ...grpc.CallOption) (*GetJobDetailResp, error) { | |||
| out := new(GetJobDetailResp) | |||
| err := c.cc.Invoke(ctx, "/hpcAC.hpcAC/GetJobDetail", in, out, opts...) | |||
| ======= | |||
| func (c *hpcACClient) FileContent(ctx context.Context, in *FileDataReq, opts ...grpc.CallOption) (*FileContentResp, error) { | |||
| out := new(FileContentResp) | |||
| err := c.cc.Invoke(ctx, "/hpcAC.hpcAC/FileContent", in, out, opts...) | |||
| >>>>>>> ff7628a455a0eb264866e5bde762cd1c671eb8f3 | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| return out, nil | |||
| } | |||
| <<<<<<< HEAD | |||
| func (c *hpcACClient) DeleteJob(ctx context.Context, in *DeleteJobReq, opts ...grpc.CallOption) (*DeleteJobResp, error) { | |||
| out := new(DeleteJobResp) | |||
| err := c.cc.Invoke(ctx, "/hpcAC.hpcAC/DeleteJob", in, out, opts...) | |||
| ======= | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| return out, nil | |||
| } | |||
| func (c *hpcACClient) FileContent(ctx context.Context, in *FileDataReq, opts ...grpc.CallOption) (*FileContentResp, error) { | |||
| out := new(FileContentResp) | |||
| err := c.cc.Invoke(ctx, "/hpcAC.hpcAC/FileContent", in, out, opts...) | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| return out, nil | |||
| } | |||
| func (c *hpcACClient) SelectQueueByUser(ctx context.Context, in *QueueReq, opts ...grpc.CallOption) (*QueueResp, error) { | |||
| out := new(QueueResp) | |||
| err := c.cc.Invoke(ctx, "/hpcAC.hpcAC/SelectQueueByUser", in, out, opts...) | |||
| @@ -132,7 +145,60 @@ func (c *hpcACClient) QueryQueueDetails(ctx context.Context, in *QueueReq, opts | |||
| func (c *hpcACClient) QueryUserQuotasLimit(ctx context.Context, in *QueueReq, opts ...grpc.CallOption) (*UserQuotasLimitResp, error) { | |||
| out := new(UserQuotasLimitResp) | |||
| err := c.cc.Invoke(ctx, "/hpcAC.hpcAC/QueryUserQuotasLimit", in, out, opts...) | |||
| >>>>>>> ff7628a455a0eb264866e5bde762cd1c671eb8f3 | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| return out, nil | |||
| } | |||
| func (c *hpcACClient) ParaStorQuota(ctx context.Context, in *ParaStorQuotaReq, opts ...grpc.CallOption) (*ParaStorQuotaResp, error) { | |||
| out := new(ParaStorQuotaResp) | |||
| err := c.cc.Invoke(ctx, "/hpcAC.hpcAC/ParaStorQuota", in, out, opts...) | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| return out, nil | |||
| } | |||
| func (c *hpcACClient) WallTime(ctx context.Context, in *WallTimeReq, opts ...grpc.CallOption) (*WallTimeResp, error) { | |||
| out := new(WallTimeResp) | |||
| err := c.cc.Invoke(ctx, "/hpcAC.hpcAC/WallTime", in, out, opts...) | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| return out, nil | |||
| } | |||
| func (c *hpcACClient) QueueJobs(ctx context.Context, in *QueueJobsReq, opts ...grpc.CallOption) (*QueueJobsResp, error) { | |||
| out := new(QueueJobsResp) | |||
| err := c.cc.Invoke(ctx, "/hpcAC.hpcAC/QueueJobs", in, out, opts...) | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| return out, nil | |||
| } | |||
| func (c *hpcACClient) CpuCore(ctx context.Context, in *CpuCoreReq, opts ...grpc.CallOption) (*CpuCoreResp, error) { | |||
| out := new(CpuCoreResp) | |||
| err := c.cc.Invoke(ctx, "/hpcAC.hpcAC/CpuCore", in, out, opts...) | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| return out, nil | |||
| } | |||
| func (c *hpcACClient) Jobs(ctx context.Context, in *JobsReq, opts ...grpc.CallOption) (*JobsResp, error) { | |||
| out := new(JobsResp) | |||
| err := c.cc.Invoke(ctx, "/hpcAC.hpcAC/jobs", in, out, opts...) | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| return out, nil | |||
| } | |||
| func (c *hpcACClient) HistoryJobDetail(ctx context.Context, in *HistoryJobDetailReq, opts ...grpc.CallOption) (*HistoryJobDetailResp, error) { | |||
| out := new(HistoryJobDetailResp) | |||
| err := c.cc.Invoke(ctx, "/hpcAC.hpcAC/HistoryJobDetail", in, out, opts...) | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| @@ -151,12 +217,10 @@ type HpcACServer interface { | |||
| SubmitJob(context.Context, *SubmitJobReq) (*SubmitJobResp, error) | |||
| // ListJobManager list all job managers | |||
| ListJobManager(context.Context, *JobManagerReq) (*ListJobManagerResp, error) | |||
| <<<<<<< HEAD | |||
| // GetJobDetail get job detail | |||
| GetJobDetail(context.Context, *JobDetailReq) (*GetJobDetailResp, error) | |||
| // DeleteJob delete job | |||
| DeleteJob(context.Context, *DeleteJobReq) (*DeleteJobResp, error) | |||
| ======= | |||
| // FileContent 查看文件内容 | |||
| FileContent(context.Context, *FileDataReq) (*FileContentResp, error) | |||
| // SelectQueueByUser 查询用户可访问队列列表 | |||
| @@ -165,7 +229,15 @@ type HpcACServer interface { | |||
| QueryQueueDetails(context.Context, *QueueReq) (*QueueDetailsResp, error) | |||
| // /QueryUserQuotasLimit 查询用户资源限制信息 | |||
| QueryUserQuotasLimit(context.Context, *QueueReq) (*UserQuotasLimitResp, error) | |||
| >>>>>>> ff7628a455a0eb264866e5bde762cd1c671eb8f3 | |||
| // ParaStor Quota | |||
| ParaStorQuota(context.Context, *ParaStorQuotaReq) (*ParaStorQuotaResp, error) | |||
| // WallTime | |||
| WallTime(context.Context, *WallTimeReq) (*WallTimeResp, error) | |||
| // QueueJobs | |||
| QueueJobs(context.Context, *QueueJobsReq) (*QueueJobsResp, error) | |||
| CpuCore(context.Context, *CpuCoreReq) (*CpuCoreResp, error) | |||
| Jobs(context.Context, *JobsReq) (*JobsResp, error) | |||
| HistoryJobDetail(context.Context, *HistoryJobDetailReq) (*HistoryJobDetailResp, error) | |||
| mustEmbedUnimplementedHpcACServer() | |||
| } | |||
| @@ -185,13 +257,12 @@ func (UnimplementedHpcACServer) SubmitJob(context.Context, *SubmitJobReq) (*Subm | |||
| func (UnimplementedHpcACServer) ListJobManager(context.Context, *JobManagerReq) (*ListJobManagerResp, error) { | |||
| return nil, status.Errorf(codes.Unimplemented, "method ListJobManager not implemented") | |||
| } | |||
| <<<<<<< HEAD | |||
| func (UnimplementedHpcACServer) GetJobDetail(context.Context, *JobDetailReq) (*GetJobDetailResp, error) { | |||
| return nil, status.Errorf(codes.Unimplemented, "method GetJobDetail not implemented") | |||
| } | |||
| func (UnimplementedHpcACServer) DeleteJob(context.Context, *DeleteJobReq) (*DeleteJobResp, error) { | |||
| return nil, status.Errorf(codes.Unimplemented, "method DeleteJob not implemented") | |||
| ======= | |||
| } | |||
| func (UnimplementedHpcACServer) FileContent(context.Context, *FileDataReq) (*FileContentResp, error) { | |||
| return nil, status.Errorf(codes.Unimplemented, "method FileContent not implemented") | |||
| } | |||
| @@ -203,7 +274,24 @@ func (UnimplementedHpcACServer) QueryQueueDetails(context.Context, *QueueReq) (* | |||
| } | |||
| func (UnimplementedHpcACServer) QueryUserQuotasLimit(context.Context, *QueueReq) (*UserQuotasLimitResp, error) { | |||
| return nil, status.Errorf(codes.Unimplemented, "method QueryUserQuotasLimit not implemented") | |||
| >>>>>>> ff7628a455a0eb264866e5bde762cd1c671eb8f3 | |||
| } | |||
| func (UnimplementedHpcACServer) ParaStorQuota(context.Context, *ParaStorQuotaReq) (*ParaStorQuotaResp, error) { | |||
| return nil, status.Errorf(codes.Unimplemented, "method ParaStorQuota not implemented") | |||
| } | |||
| func (UnimplementedHpcACServer) WallTime(context.Context, *WallTimeReq) (*WallTimeResp, error) { | |||
| return nil, status.Errorf(codes.Unimplemented, "method WallTime not implemented") | |||
| } | |||
| func (UnimplementedHpcACServer) QueueJobs(context.Context, *QueueJobsReq) (*QueueJobsResp, error) { | |||
| return nil, status.Errorf(codes.Unimplemented, "method QueueJobs not implemented") | |||
| } | |||
| func (UnimplementedHpcACServer) CpuCore(context.Context, *CpuCoreReq) (*CpuCoreResp, error) { | |||
| return nil, status.Errorf(codes.Unimplemented, "method CpuCore not implemented") | |||
| } | |||
| func (UnimplementedHpcACServer) Jobs(context.Context, *JobsReq) (*JobsResp, error) { | |||
| return nil, status.Errorf(codes.Unimplemented, "method Jobs not implemented") | |||
| } | |||
| func (UnimplementedHpcACServer) HistoryJobDetail(context.Context, *HistoryJobDetailReq) (*HistoryJobDetailResp, error) { | |||
| return nil, status.Errorf(codes.Unimplemented, "method HistoryJobDetail not implemented") | |||
| } | |||
| func (UnimplementedHpcACServer) mustEmbedUnimplementedHpcACServer() {} | |||
| @@ -290,18 +378,12 @@ func _HpcAC_ListJobManager_Handler(srv interface{}, ctx context.Context, dec fun | |||
| return interceptor(ctx, in, info, handler) | |||
| } | |||
| <<<<<<< HEAD | |||
| func _HpcAC_GetJobDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | |||
| in := new(JobDetailReq) | |||
| ======= | |||
| func _HpcAC_FileContent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | |||
| in := new(FileDataReq) | |||
| >>>>>>> ff7628a455a0eb264866e5bde762cd1c671eb8f3 | |||
| if err := dec(in); err != nil { | |||
| return nil, err | |||
| } | |||
| if interceptor == nil { | |||
| <<<<<<< HEAD | |||
| return srv.(HpcACServer).GetJobDetail(ctx, in) | |||
| } | |||
| info := &grpc.UnaryServerInfo{ | |||
| @@ -310,32 +392,16 @@ func _HpcAC_FileContent_Handler(srv interface{}, ctx context.Context, dec func(i | |||
| } | |||
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { | |||
| return srv.(HpcACServer).GetJobDetail(ctx, req.(*JobDetailReq)) | |||
| ======= | |||
| return srv.(HpcACServer).FileContent(ctx, in) | |||
| } | |||
| info := &grpc.UnaryServerInfo{ | |||
| Server: srv, | |||
| FullMethod: "/hpcAC.hpcAC/FileContent", | |||
| } | |||
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { | |||
| return srv.(HpcACServer).FileContent(ctx, req.(*FileDataReq)) | |||
| >>>>>>> ff7628a455a0eb264866e5bde762cd1c671eb8f3 | |||
| } | |||
| return interceptor(ctx, in, info, handler) | |||
| } | |||
| <<<<<<< HEAD | |||
| func _HpcAC_DeleteJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | |||
| in := new(DeleteJobReq) | |||
| ======= | |||
| func _HpcAC_SelectQueueByUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | |||
| in := new(QueueReq) | |||
| >>>>>>> ff7628a455a0eb264866e5bde762cd1c671eb8f3 | |||
| if err := dec(in); err != nil { | |||
| return nil, err | |||
| } | |||
| if interceptor == nil { | |||
| <<<<<<< HEAD | |||
| return srv.(HpcACServer).DeleteJob(ctx, in) | |||
| } | |||
| info := &grpc.UnaryServerInfo{ | |||
| @@ -344,7 +410,34 @@ func _HpcAC_SelectQueueByUser_Handler(srv interface{}, ctx context.Context, dec | |||
| } | |||
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { | |||
| return srv.(HpcACServer).DeleteJob(ctx, req.(*DeleteJobReq)) | |||
| ======= | |||
| } | |||
| return interceptor(ctx, in, info, handler) | |||
| } | |||
| func _HpcAC_FileContent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | |||
| in := new(FileDataReq) | |||
| if err := dec(in); err != nil { | |||
| return nil, err | |||
| } | |||
| if interceptor == nil { | |||
| return srv.(HpcACServer).FileContent(ctx, in) | |||
| } | |||
| info := &grpc.UnaryServerInfo{ | |||
| Server: srv, | |||
| FullMethod: "/hpcAC.hpcAC/FileContent", | |||
| } | |||
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { | |||
| return srv.(HpcACServer).FileContent(ctx, req.(*FileDataReq)) | |||
| } | |||
| return interceptor(ctx, in, info, handler) | |||
| } | |||
| func _HpcAC_SelectQueueByUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | |||
| in := new(QueueReq) | |||
| if err := dec(in); err != nil { | |||
| return nil, err | |||
| } | |||
| if interceptor == nil { | |||
| return srv.(HpcACServer).SelectQueueByUser(ctx, in) | |||
| } | |||
| info := &grpc.UnaryServerInfo{ | |||
| @@ -389,7 +482,114 @@ func _HpcAC_QueryUserQuotasLimit_Handler(srv interface{}, ctx context.Context, d | |||
| } | |||
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { | |||
| return srv.(HpcACServer).QueryUserQuotasLimit(ctx, req.(*QueueReq)) | |||
| >>>>>>> ff7628a455a0eb264866e5bde762cd1c671eb8f3 | |||
| } | |||
| return interceptor(ctx, in, info, handler) | |||
| } | |||
| func _HpcAC_ParaStorQuota_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | |||
| in := new(ParaStorQuotaReq) | |||
| if err := dec(in); err != nil { | |||
| return nil, err | |||
| } | |||
| if interceptor == nil { | |||
| return srv.(HpcACServer).ParaStorQuota(ctx, in) | |||
| } | |||
| info := &grpc.UnaryServerInfo{ | |||
| Server: srv, | |||
| FullMethod: "/hpcAC.hpcAC/ParaStorQuota", | |||
| } | |||
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { | |||
| return srv.(HpcACServer).ParaStorQuota(ctx, req.(*ParaStorQuotaReq)) | |||
| } | |||
| return interceptor(ctx, in, info, handler) | |||
| } | |||
| func _HpcAC_WallTime_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | |||
| in := new(WallTimeReq) | |||
| if err := dec(in); err != nil { | |||
| return nil, err | |||
| } | |||
| if interceptor == nil { | |||
| return srv.(HpcACServer).WallTime(ctx, in) | |||
| } | |||
| info := &grpc.UnaryServerInfo{ | |||
| Server: srv, | |||
| FullMethod: "/hpcAC.hpcAC/WallTime", | |||
| } | |||
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { | |||
| return srv.(HpcACServer).WallTime(ctx, req.(*WallTimeReq)) | |||
| } | |||
| return interceptor(ctx, in, info, handler) | |||
| } | |||
| func _HpcAC_QueueJobs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | |||
| in := new(QueueJobsReq) | |||
| if err := dec(in); err != nil { | |||
| return nil, err | |||
| } | |||
| if interceptor == nil { | |||
| return srv.(HpcACServer).QueueJobs(ctx, in) | |||
| } | |||
| info := &grpc.UnaryServerInfo{ | |||
| Server: srv, | |||
| FullMethod: "/hpcAC.hpcAC/QueueJobs", | |||
| } | |||
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { | |||
| return srv.(HpcACServer).QueueJobs(ctx, req.(*QueueJobsReq)) | |||
| } | |||
| return interceptor(ctx, in, info, handler) | |||
| } | |||
| func _HpcAC_CpuCore_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | |||
| in := new(CpuCoreReq) | |||
| if err := dec(in); err != nil { | |||
| return nil, err | |||
| } | |||
| if interceptor == nil { | |||
| return srv.(HpcACServer).CpuCore(ctx, in) | |||
| } | |||
| info := &grpc.UnaryServerInfo{ | |||
| Server: srv, | |||
| FullMethod: "/hpcAC.hpcAC/CpuCore", | |||
| } | |||
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { | |||
| return srv.(HpcACServer).CpuCore(ctx, req.(*CpuCoreReq)) | |||
| } | |||
| return interceptor(ctx, in, info, handler) | |||
| } | |||
| func _HpcAC_Jobs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | |||
| in := new(JobsReq) | |||
| if err := dec(in); err != nil { | |||
| return nil, err | |||
| } | |||
| if interceptor == nil { | |||
| return srv.(HpcACServer).Jobs(ctx, in) | |||
| } | |||
| info := &grpc.UnaryServerInfo{ | |||
| Server: srv, | |||
| FullMethod: "/hpcAC.hpcAC/jobs", | |||
| } | |||
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { | |||
| return srv.(HpcACServer).Jobs(ctx, req.(*JobsReq)) | |||
| } | |||
| return interceptor(ctx, in, info, handler) | |||
| } | |||
| func _HpcAC_HistoryJobDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | |||
| in := new(HistoryJobDetailReq) | |||
| if err := dec(in); err != nil { | |||
| return nil, err | |||
| } | |||
| if interceptor == nil { | |||
| return srv.(HpcACServer).HistoryJobDetail(ctx, in) | |||
| } | |||
| info := &grpc.UnaryServerInfo{ | |||
| Server: srv, | |||
| FullMethod: "/hpcAC.hpcAC/HistoryJobDetail", | |||
| } | |||
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { | |||
| return srv.(HpcACServer).HistoryJobDetail(ctx, req.(*HistoryJobDetailReq)) | |||
| } | |||
| return interceptor(ctx, in, info, handler) | |||
| } | |||
| @@ -418,14 +618,14 @@ var HpcAC_ServiceDesc = grpc.ServiceDesc{ | |||
| Handler: _HpcAC_ListJobManager_Handler, | |||
| }, | |||
| { | |||
| <<<<<<< HEAD | |||
| MethodName: "GetJobDetail", | |||
| Handler: _HpcAC_GetJobDetail_Handler, | |||
| }, | |||
| { | |||
| MethodName: "DeleteJob", | |||
| Handler: _HpcAC_DeleteJob_Handler, | |||
| ======= | |||
| }, | |||
| { | |||
| MethodName: "FileContent", | |||
| Handler: _HpcAC_FileContent_Handler, | |||
| }, | |||
| @@ -440,7 +640,30 @@ var HpcAC_ServiceDesc = grpc.ServiceDesc{ | |||
| { | |||
| MethodName: "QueryUserQuotasLimit", | |||
| Handler: _HpcAC_QueryUserQuotasLimit_Handler, | |||
| >>>>>>> ff7628a455a0eb264866e5bde762cd1c671eb8f3 | |||
| }, | |||
| { | |||
| MethodName: "ParaStorQuota", | |||
| Handler: _HpcAC_ParaStorQuota_Handler, | |||
| }, | |||
| { | |||
| MethodName: "WallTime", | |||
| Handler: _HpcAC_WallTime_Handler, | |||
| }, | |||
| { | |||
| MethodName: "QueueJobs", | |||
| Handler: _HpcAC_QueueJobs_Handler, | |||
| }, | |||
| { | |||
| MethodName: "CpuCore", | |||
| Handler: _HpcAC_CpuCore_Handler, | |||
| }, | |||
| { | |||
| MethodName: "jobs", | |||
| Handler: _HpcAC_Jobs_Handler, | |||
| }, | |||
| { | |||
| MethodName: "HistoryJobDetail", | |||
| Handler: _HpcAC_HistoryJobDetail_Handler, | |||
| }, | |||
| }, | |||
| Streams: []grpc.StreamDesc{}, | |||
| @@ -13,50 +13,53 @@ import ( | |||
| ) | |||
| type ( | |||
| <<<<<<< HEAD | |||
| DeleteJobReq = hpcAC.DeleteJobReq | |||
| DeleteJobResp = hpcAC.DeleteJobResp | |||
| GetJobDetailResp = hpcAC.GetJobDetailResp | |||
| HistoryJob = hpcAC.HistoryJob | |||
| Job = hpcAC.Job | |||
| JobDetail = hpcAC.JobDetail | |||
| JobDetailReq = hpcAC.JobDetailReq | |||
| JobInitAttr = hpcAC.JobInitAttr | |||
| JobManager = hpcAC.JobManager | |||
| JobManagerReq = hpcAC.JobManagerReq | |||
| JobVncSessionInfo = hpcAC.JobVncSessionInfo | |||
| ListHistoryJobReq = hpcAC.ListHistoryJobReq | |||
| ListHistoryJobResp = hpcAC.ListHistoryJobResp | |||
| ListJobManagerResp = hpcAC.ListJobManagerResp | |||
| ListJobReq = hpcAC.ListJobReq | |||
| ListJobResp = hpcAC.ListJobResp | |||
| MapAppJobInfo = hpcAC.MapAppJobInfo | |||
| SubmitJobReq = hpcAC.SubmitJobReq | |||
| SubmitJobResp = hpcAC.SubmitJobResp | |||
| ======= | |||
| FileContentResp = hpcAC.FileContentResp | |||
| FileDataReq = hpcAC.FileDataReq | |||
| FileDataResp = hpcAC.FileDataResp | |||
| HistoryJob = hpcAC.HistoryJob | |||
| Job = hpcAC.Job | |||
| JobManager = hpcAC.JobManager | |||
| JobManagerReq = hpcAC.JobManagerReq | |||
| ListHistoryJobReq = hpcAC.ListHistoryJobReq | |||
| ListHistoryJobResp = hpcAC.ListHistoryJobResp | |||
| ListJobManagerResp = hpcAC.ListJobManagerResp | |||
| ListJobReq = hpcAC.ListJobReq | |||
| ListJobResp = hpcAC.ListJobResp | |||
| MapAppJobInfo = hpcAC.MapAppJobInfo | |||
| QueueData = hpcAC.QueueData | |||
| QueueDetailsData = hpcAC.QueueDetailsData | |||
| QueueDetailsResp = hpcAC.QueueDetailsResp | |||
| QueueReq = hpcAC.QueueReq | |||
| QueueResp = hpcAC.QueueResp | |||
| SubmitJobReq = hpcAC.SubmitJobReq | |||
| SubmitJobResp = hpcAC.SubmitJobResp | |||
| UserQuotasLimitData = hpcAC.UserQuotasLimitData | |||
| UserQuotasLimitResp = hpcAC.UserQuotasLimitResp | |||
| >>>>>>> ff7628a455a0eb264866e5bde762cd1c671eb8f3 | |||
| CpuCore = hpcAC.CpuCore | |||
| CpuCoreReq = hpcAC.CpuCoreReq | |||
| CpuCoreResp = hpcAC.CpuCoreResp | |||
| DeleteJobReq = hpcAC.DeleteJobReq | |||
| DeleteJobResp = hpcAC.DeleteJobResp | |||
| FileContentResp = hpcAC.FileContentResp | |||
| FileDataReq = hpcAC.FileDataReq | |||
| FileDataResp = hpcAC.FileDataResp | |||
| GetJobDetailResp = hpcAC.GetJobDetailResp | |||
| HistoryJob = hpcAC.HistoryJob | |||
| HistoryJobDetailReq = hpcAC.HistoryJobDetailReq | |||
| HistoryJobDetailResp = hpcAC.HistoryJobDetailResp | |||
| HistoryJobDetailRespData = hpcAC.HistoryJobDetailRespData | |||
| Job = hpcAC.Job | |||
| JobCore = hpcAC.JobCore | |||
| JobDetail = hpcAC.JobDetail | |||
| JobDetailReq = hpcAC.JobDetailReq | |||
| JobInitAttr = hpcAC.JobInitAttr | |||
| JobManager = hpcAC.JobManager | |||
| JobManagerReq = hpcAC.JobManagerReq | |||
| JobVncSessionInfo = hpcAC.JobVncSessionInfo | |||
| JobsReq = hpcAC.JobsReq | |||
| JobsResp = hpcAC.JobsResp | |||
| ListHistoryJobReq = hpcAC.ListHistoryJobReq | |||
| ListHistoryJobResp = hpcAC.ListHistoryJobResp | |||
| ListJobManagerResp = hpcAC.ListJobManagerResp | |||
| ListJobReq = hpcAC.ListJobReq | |||
| ListJobResp = hpcAC.ListJobResp | |||
| MapAppJobInfo = hpcAC.MapAppJobInfo | |||
| Metric = hpcAC.Metric | |||
| ParaStorQuotaReq = hpcAC.ParaStorQuotaReq | |||
| ParaStorQuotaResp = hpcAC.ParaStorQuotaResp | |||
| Queue = hpcAC.Queue | |||
| QueueData = hpcAC.QueueData | |||
| QueueDetailsData = hpcAC.QueueDetailsData | |||
| QueueDetailsResp = hpcAC.QueueDetailsResp | |||
| QueueJobsReq = hpcAC.QueueJobsReq | |||
| QueueJobsResp = hpcAC.QueueJobsResp | |||
| QueueReq = hpcAC.QueueReq | |||
| QueueResp = hpcAC.QueueResp | |||
| QuotaData = hpcAC.QuotaData | |||
| SubmitJobReq = hpcAC.SubmitJobReq | |||
| SubmitJobResp = hpcAC.SubmitJobResp | |||
| UserQuotasLimitData = hpcAC.UserQuotasLimitData | |||
| UserQuotasLimitResp = hpcAC.UserQuotasLimitResp | |||
| WallTimeReq = hpcAC.WallTimeReq | |||
| WallTimeResp = hpcAC.WallTimeResp | |||
| HpcAC interface { | |||
| // ListJob list all jobs | |||
| @@ -67,12 +70,10 @@ type ( | |||
| SubmitJob(ctx context.Context, in *SubmitJobReq, opts ...grpc.CallOption) (*SubmitJobResp, error) | |||
| // ListJobManager list all job managers | |||
| ListJobManager(ctx context.Context, in *JobManagerReq, opts ...grpc.CallOption) (*ListJobManagerResp, error) | |||
| <<<<<<< HEAD | |||
| // GetJobDetail get job detail | |||
| GetJobDetail(ctx context.Context, in *JobDetailReq, opts ...grpc.CallOption) (*GetJobDetailResp, error) | |||
| // DeleteJob delete job | |||
| DeleteJob(ctx context.Context, in *DeleteJobReq, opts ...grpc.CallOption) (*DeleteJobResp, error) | |||
| ======= | |||
| // FileContent 查看文件内容 | |||
| FileContent(ctx context.Context, in *FileDataReq, opts ...grpc.CallOption) (*FileContentResp, error) | |||
| // SelectQueueByUser 查询用户可访问队列列表 | |||
| @@ -81,7 +82,15 @@ type ( | |||
| QueryQueueDetails(ctx context.Context, in *QueueReq, opts ...grpc.CallOption) (*QueueDetailsResp, error) | |||
| // QueryUserQuotasLimit 查询用户资源限制信息 | |||
| QueryUserQuotasLimit(ctx context.Context, in *QueueReq, opts ...grpc.CallOption) (*UserQuotasLimitResp, error) | |||
| >>>>>>> ff7628a455a0eb264866e5bde762cd1c671eb8f3 | |||
| // ParaStor Quota | |||
| ParaStorQuota(ctx context.Context, in *ParaStorQuotaReq, opts ...grpc.CallOption) (*ParaStorQuotaResp, error) | |||
| // WallTime | |||
| WallTime(ctx context.Context, in *WallTimeReq, opts ...grpc.CallOption) (*WallTimeResp, error) | |||
| // QueueJobs | |||
| QueueJobs(ctx context.Context, in *QueueJobsReq, opts ...grpc.CallOption) (*QueueJobsResp, error) | |||
| CpuCore(ctx context.Context, in *CpuCoreReq, opts ...grpc.CallOption) (*CpuCoreResp, error) | |||
| Jobs(ctx context.Context, in *JobsReq, opts ...grpc.CallOption) (*JobsResp, error) | |||
| HistoryJobDetail(ctx context.Context, in *HistoryJobDetailReq, opts ...grpc.CallOption) (*HistoryJobDetailResp, error) | |||
| } | |||
| defaultHpcAC struct { | |||
| @@ -119,7 +128,6 @@ func (m *defaultHpcAC) ListJobManager(ctx context.Context, in *JobManagerReq, op | |||
| return client.ListJobManager(ctx, in, opts...) | |||
| } | |||
| <<<<<<< HEAD | |||
| // GetJobDetail get job detail | |||
| func (m *defaultHpcAC) GetJobDetail(ctx context.Context, in *JobDetailReq, opts ...grpc.CallOption) (*GetJobDetailResp, error) { | |||
| client := hpcAC.NewHpcACClient(m.cli.Conn()) | |||
| @@ -130,7 +138,8 @@ func (m *defaultHpcAC) GetJobDetail(ctx context.Context, in *JobDetailReq, opts | |||
| func (m *defaultHpcAC) DeleteJob(ctx context.Context, in *DeleteJobReq, opts ...grpc.CallOption) (*DeleteJobResp, error) { | |||
| client := hpcAC.NewHpcACClient(m.cli.Conn()) | |||
| return client.DeleteJob(ctx, in, opts...) | |||
| ======= | |||
| } | |||
| // FileContent 查看文件内容 | |||
| func (m *defaultHpcAC) FileContent(ctx context.Context, in *FileDataReq, opts ...grpc.CallOption) (*FileContentResp, error) { | |||
| client := hpcAC.NewHpcACClient(m.cli.Conn()) | |||
| @@ -153,5 +162,37 @@ func (m *defaultHpcAC) QueryQueueDetails(ctx context.Context, in *QueueReq, opts | |||
| func (m *defaultHpcAC) QueryUserQuotasLimit(ctx context.Context, in *QueueReq, opts ...grpc.CallOption) (*UserQuotasLimitResp, error) { | |||
| client := hpcAC.NewHpcACClient(m.cli.Conn()) | |||
| return client.QueryUserQuotasLimit(ctx, in, opts...) | |||
| >>>>>>> ff7628a455a0eb264866e5bde762cd1c671eb8f3 | |||
| } | |||
| // ParaStor Quota | |||
| func (m *defaultHpcAC) ParaStorQuota(ctx context.Context, in *ParaStorQuotaReq, opts ...grpc.CallOption) (*ParaStorQuotaResp, error) { | |||
| client := hpcAC.NewHpcACClient(m.cli.Conn()) | |||
| return client.ParaStorQuota(ctx, in, opts...) | |||
| } | |||
| // WallTime | |||
| func (m *defaultHpcAC) WallTime(ctx context.Context, in *WallTimeReq, opts ...grpc.CallOption) (*WallTimeResp, error) { | |||
| client := hpcAC.NewHpcACClient(m.cli.Conn()) | |||
| return client.WallTime(ctx, in, opts...) | |||
| } | |||
| // QueueJobs | |||
| func (m *defaultHpcAC) QueueJobs(ctx context.Context, in *QueueJobsReq, opts ...grpc.CallOption) (*QueueJobsResp, error) { | |||
| client := hpcAC.NewHpcACClient(m.cli.Conn()) | |||
| return client.QueueJobs(ctx, in, opts...) | |||
| } | |||
| func (m *defaultHpcAC) CpuCore(ctx context.Context, in *CpuCoreReq, opts ...grpc.CallOption) (*CpuCoreResp, error) { | |||
| client := hpcAC.NewHpcACClient(m.cli.Conn()) | |||
| return client.CpuCore(ctx, in, opts...) | |||
| } | |||
| func (m *defaultHpcAC) Jobs(ctx context.Context, in *JobsReq, opts ...grpc.CallOption) (*JobsResp, error) { | |||
| client := hpcAC.NewHpcACClient(m.cli.Conn()) | |||
| return client.Jobs(ctx, in, opts...) | |||
| } | |||
| func (m *defaultHpcAC) HistoryJobDetail(ctx context.Context, in *HistoryJobDetailReq, opts ...grpc.CallOption) (*HistoryJobDetailResp, error) { | |||
| client := hpcAC.NewHpcACClient(m.cli.Conn()) | |||
| return client.HistoryJobDetail(ctx, in, opts...) | |||
| } | |||
| @@ -0,0 +1,37 @@ | |||
| package logic | |||
| import ( | |||
| "PCM/adaptor/PCM-HPC/PCM-AC/rpc/internal/util" | |||
| "PCM/common/tool" | |||
| "context" | |||
| "PCM/adaptor/PCM-HPC/PCM-AC/rpc/hpcAC" | |||
| "PCM/adaptor/PCM-HPC/PCM-AC/rpc/internal/svc" | |||
| "github.com/zeromicro/go-zero/core/logx" | |||
| ) | |||
| type CpuCoreLogic struct { | |||
| ctx context.Context | |||
| svcCtx *svc.ServiceContext | |||
| logx.Logger | |||
| } | |||
| func NewCpuCoreLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CpuCoreLogic { | |||
| return &CpuCoreLogic{ | |||
| ctx: ctx, | |||
| svcCtx: svcCtx, | |||
| Logger: logx.WithContext(ctx), | |||
| } | |||
| } | |||
| func (l *CpuCoreLogic) CpuCore(in *hpcAC.CpuCoreReq) (*hpcAC.CpuCoreResp, error) { | |||
| url := "https://api01.hpccube.com:65106/hpc/openapi/v2/view/cpucore/state" | |||
| var cpuCoreResp *hpcAC.CpuCoreResp | |||
| acHttpRequest := tool.GetACHttpRequest() | |||
| acHttpRequest.SetHeader(tool.ContentType, tool.ApplicationJson). | |||
| SetResult(&cpuCoreResp). | |||
| SetHeader("token", util.GetToken()). | |||
| Get(url) | |||
| return cpuCoreResp, nil | |||
| } | |||
| @@ -0,0 +1,39 @@ | |||
| package logic | |||
| import ( | |||
| "PCM/adaptor/PCM-HPC/PCM-AC/rpc/internal/util" | |||
| "PCM/common/tool" | |||
| "context" | |||
| "fmt" | |||
| "PCM/adaptor/PCM-HPC/PCM-AC/rpc/hpcAC" | |||
| "PCM/adaptor/PCM-HPC/PCM-AC/rpc/internal/svc" | |||
| "github.com/zeromicro/go-zero/core/logx" | |||
| ) | |||
| type HistoryJobDetailLogic struct { | |||
| ctx context.Context | |||
| svcCtx *svc.ServiceContext | |||
| logx.Logger | |||
| } | |||
| func NewHistoryJobDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *HistoryJobDetailLogic { | |||
| return &HistoryJobDetailLogic{ | |||
| ctx: ctx, | |||
| svcCtx: svcCtx, | |||
| Logger: logx.WithContext(ctx), | |||
| } | |||
| } | |||
| func (l *HistoryJobDetailLogic) HistoryJobDetail(in *hpcAC.HistoryJobDetailReq) (*hpcAC.HistoryJobDetailResp, error) { | |||
| url := fmt.Sprint("https://api01.hpccube.com:65106//hpc/openapi/v2/historyjobs/%s/%s?acctTime=%s", in.JobmanagerId, in.JobId, in.AcctTime) | |||
| var jobsResp *hpcAC.JobsResp | |||
| acHttpRequest := tool.GetACHttpRequest() | |||
| acHttpRequest.SetHeader(tool.ContentType, tool.ApplicationJson). | |||
| SetResult(&jobsResp). | |||
| SetHeader("token", util.GetToken()). | |||
| Get(url) | |||
| return &hpcAC.HistoryJobDetailResp{}, nil | |||
| } | |||
| @@ -0,0 +1,36 @@ | |||
| package logic | |||
| import ( | |||
| "PCM/adaptor/PCM-HPC/PCM-AC/rpc/hpcAC" | |||
| "PCM/adaptor/PCM-HPC/PCM-AC/rpc/internal/svc" | |||
| "PCM/adaptor/PCM-HPC/PCM-AC/rpc/internal/util" | |||
| "PCM/common/tool" | |||
| "context" | |||
| "github.com/zeromicro/go-zero/core/logx" | |||
| ) | |||
| type JobsLogic struct { | |||
| ctx context.Context | |||
| svcCtx *svc.ServiceContext | |||
| logx.Logger | |||
| } | |||
| func NewJobsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *JobsLogic { | |||
| return &JobsLogic{ | |||
| ctx: ctx, | |||
| svcCtx: svcCtx, | |||
| Logger: logx.WithContext(ctx), | |||
| } | |||
| } | |||
| func (l *JobsLogic) Jobs(in *hpcAC.JobsReq) (*hpcAC.JobsResp, error) { | |||
| url := "https://api01.hpccube.com:65106/hpc/openapi/v2/view/jobs/state?userName=" + in.UserName | |||
| var jobsResp *hpcAC.JobsResp | |||
| acHttpRequest := tool.GetACHttpRequest() | |||
| acHttpRequest.SetHeader(tool.ContentType, tool.ApplicationJson). | |||
| SetResult(&jobsResp). | |||
| SetHeader("token", util.GetToken()). | |||
| Get(url) | |||
| return jobsResp, nil | |||
| } | |||
| @@ -67,7 +67,7 @@ func (l *ListJobManagerLogic) ListJobManager(in *hpcAC.JobManagerReq) (*hpcAC.Li | |||
| if err = json.Unmarshal(body, &resp); err != nil { | |||
| if resp.Code != "0" { | |||
| resp.JobManagers = nil | |||
| resp.Data = nil | |||
| } else { | |||
| return nil, err | |||
| } | |||
| @@ -0,0 +1,40 @@ | |||
| package logic | |||
| import ( | |||
| "PCM/adaptor/PCM-HPC/PCM-AC/rpc/internal/util" | |||
| "PCM/common/tool" | |||
| "context" | |||
| "PCM/adaptor/PCM-HPC/PCM-AC/rpc/hpcAC" | |||
| "PCM/adaptor/PCM-HPC/PCM-AC/rpc/internal/svc" | |||
| "github.com/zeromicro/go-zero/core/logx" | |||
| ) | |||
| type ParaStorQuotaLogic struct { | |||
| ctx context.Context | |||
| svcCtx *svc.ServiceContext | |||
| logx.Logger | |||
| } | |||
| func NewParaStorQuotaLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ParaStorQuotaLogic { | |||
| return &ParaStorQuotaLogic{ | |||
| ctx: ctx, | |||
| svcCtx: svcCtx, | |||
| Logger: logx.WithContext(ctx), | |||
| } | |||
| } | |||
| // ParaStor Quota | |||
| func (l *ParaStorQuotaLogic) ParaStorQuota(in *hpcAC.ParaStorQuotaReq) (*hpcAC.ParaStorQuotaResp, error) { | |||
| // todo: add your logic here and delete this line | |||
| println("token:", util.GetToken()) | |||
| url := "https://api01.hpccube.com:65106/hpc/openapi/v2/parastor/quota/usernames/" + in.Username | |||
| var acResp *hpcAC.ParaStorQuotaResp | |||
| acHttpRequest := tool.GetACHttpRequest() | |||
| acHttpRequest.SetHeader(tool.ContentType, tool.ApplicationJson). | |||
| SetResult(&acResp). | |||
| SetHeader("token", util.GetToken()). | |||
| Get(url) | |||
| return acResp, nil | |||
| } | |||
| @@ -0,0 +1,38 @@ | |||
| package logic | |||
| import ( | |||
| "PCM/adaptor/PCM-HPC/PCM-AC/rpc/internal/util" | |||
| "PCM/common/tool" | |||
| "context" | |||
| "PCM/adaptor/PCM-HPC/PCM-AC/rpc/hpcAC" | |||
| "PCM/adaptor/PCM-HPC/PCM-AC/rpc/internal/svc" | |||
| "github.com/zeromicro/go-zero/core/logx" | |||
| ) | |||
| type QueueJobsLogic struct { | |||
| ctx context.Context | |||
| svcCtx *svc.ServiceContext | |||
| logx.Logger | |||
| } | |||
| func NewQueueJobsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *QueueJobsLogic { | |||
| return &QueueJobsLogic{ | |||
| ctx: ctx, | |||
| svcCtx: svcCtx, | |||
| Logger: logx.WithContext(ctx), | |||
| } | |||
| } | |||
| // QueueJobs | |||
| func (l *QueueJobsLogic) QueueJobs(in *hpcAC.QueueJobsReq) (*hpcAC.QueueJobsResp, error) { | |||
| url := "https://api01.hpccube.com:65106/hpc/openapi/v2/view/queue/jobs?userName=" + in.UserName | |||
| var queueJobsResp *hpcAC.QueueJobsResp | |||
| acHttpRequest := tool.GetACHttpRequest() | |||
| acHttpRequest.SetHeader(tool.ContentType, tool.ApplicationJson). | |||
| SetResult(&queueJobsResp). | |||
| SetHeader("token", util.GetToken()). | |||
| Get(url) | |||
| return queueJobsResp, nil | |||
| } | |||
| @@ -0,0 +1,37 @@ | |||
| package logic | |||
| import ( | |||
| "PCM/adaptor/PCM-HPC/PCM-AC/rpc/hpcAC" | |||
| "PCM/adaptor/PCM-HPC/PCM-AC/rpc/internal/svc" | |||
| "PCM/adaptor/PCM-HPC/PCM-AC/rpc/internal/util" | |||
| "PCM/common/tool" | |||
| "context" | |||
| "github.com/zeromicro/go-zero/core/logx" | |||
| ) | |||
| type WallTimeLogic struct { | |||
| ctx context.Context | |||
| svcCtx *svc.ServiceContext | |||
| logx.Logger | |||
| } | |||
| func NewWallTimeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WallTimeLogic { | |||
| return &WallTimeLogic{ | |||
| ctx: ctx, | |||
| svcCtx: svcCtx, | |||
| Logger: logx.WithContext(ctx), | |||
| } | |||
| } | |||
| func (l *WallTimeLogic) WallTime(in *hpcAC.WallTimeReq) (*hpcAC.WallTimeResp, error) { | |||
| url := "https://api01.hpccube.com:65106/hpc/openapi/v2/view/walltime/users/" + in.Username | |||
| var wallTimeResp *hpcAC.WallTimeResp | |||
| acHttpRequest := tool.GetACHttpRequest() | |||
| acHttpRequest. | |||
| SetResult(&wallTimeResp). | |||
| SetHeader(tool.ContentType, tool.ApplicationJson). | |||
| SetHeader("token", util.GetToken()). | |||
| Get(url) | |||
| return wallTimeResp, nil | |||
| } | |||
| @@ -46,7 +46,6 @@ func (s *HpcACServer) ListJobManager(ctx context.Context, in *hpcAC.JobManagerRe | |||
| return l.ListJobManager(in) | |||
| } | |||
| <<<<<<< HEAD | |||
| // GetJobDetail get job detail | |||
| func (s *HpcACServer) GetJobDetail(ctx context.Context, in *hpcAC.JobDetailReq) (*hpcAC.GetJobDetailResp, error) { | |||
| l := logic.NewGetJobDetailLogic(ctx, s.svcCtx) | |||
| @@ -57,7 +56,8 @@ func (s *HpcACServer) GetJobDetail(ctx context.Context, in *hpcAC.JobDetailReq) | |||
| func (s *HpcACServer) DeleteJob(ctx context.Context, in *hpcAC.DeleteJobReq) (*hpcAC.DeleteJobResp, error) { | |||
| l := logic.NewDeleteJobLogic(ctx, s.svcCtx) | |||
| return l.DeleteJob(in) | |||
| ======= | |||
| } | |||
| // FileContent 查看文件内容 | |||
| func (s *HpcACServer) FileContent(ctx context.Context, in *hpcAC.FileDataReq) (*hpcAC.FileContentResp, error) { | |||
| l := logic.NewFileContentLogic(ctx, s.svcCtx) | |||
| @@ -80,5 +80,37 @@ func (s *HpcACServer) QueryQueueDetails(ctx context.Context, in *hpcAC.QueueReq) | |||
| func (s *HpcACServer) QueryUserQuotasLimit(ctx context.Context, in *hpcAC.QueueReq) (*hpcAC.UserQuotasLimitResp, error) { | |||
| l := logic.NewQueryUserQuotasLimitLogic(ctx, s.svcCtx) | |||
| return l.QueryUserQuotasLimit(in) | |||
| >>>>>>> ff7628a455a0eb264866e5bde762cd1c671eb8f3 | |||
| } | |||
| // ParaStor Quota | |||
| func (s *HpcACServer) ParaStorQuota(ctx context.Context, in *hpcAC.ParaStorQuotaReq) (*hpcAC.ParaStorQuotaResp, error) { | |||
| l := logic.NewParaStorQuotaLogic(ctx, s.svcCtx) | |||
| return l.ParaStorQuota(in) | |||
| } | |||
| // WallTime | |||
| func (s *HpcACServer) WallTime(ctx context.Context, in *hpcAC.WallTimeReq) (*hpcAC.WallTimeResp, error) { | |||
| l := logic.NewWallTimeLogic(ctx, s.svcCtx) | |||
| return l.WallTime(in) | |||
| } | |||
| // QueueJobs | |||
| func (s *HpcACServer) QueueJobs(ctx context.Context, in *hpcAC.QueueJobsReq) (*hpcAC.QueueJobsResp, error) { | |||
| l := logic.NewQueueJobsLogic(ctx, s.svcCtx) | |||
| return l.QueueJobs(in) | |||
| } | |||
| func (s *HpcACServer) CpuCore(ctx context.Context, in *hpcAC.CpuCoreReq) (*hpcAC.CpuCoreResp, error) { | |||
| l := logic.NewCpuCoreLogic(ctx, s.svcCtx) | |||
| return l.CpuCore(in) | |||
| } | |||
| func (s *HpcACServer) Jobs(ctx context.Context, in *hpcAC.JobsReq) (*hpcAC.JobsResp, error) { | |||
| l := logic.NewJobsLogic(ctx, s.svcCtx) | |||
| return l.Jobs(in) | |||
| } | |||
| func (s *HpcACServer) HistoryJobDetail(ctx context.Context, in *hpcAC.HistoryJobDetailReq) (*hpcAC.HistoryJobDetailResp, error) { | |||
| l := logic.NewHistoryJobDetailLogic(ctx, s.svcCtx) | |||
| return l.HistoryJobDetail(in) | |||
| } | |||
| @@ -18,7 +18,7 @@ message JobManagerReq{ | |||
| message ListJobManagerResp{ | |||
| string code = 1; // @gotags: copier:"Code", json:"code" | |||
| string msg = 2; // @gotags: copier:"Msg", json:"msg" | |||
| repeated JobManager job_managers = 3; // @gotags: copier:"JobManagers", json:"data" | |||
| repeated JobManager data = 3; // @gotags: copier:"JobManagers", json:"data" | |||
| } | |||
| /******************Cluster End*************************/ | |||
| @@ -277,6 +277,157 @@ message MapAppJobInfo{ | |||
| } | |||
| /******************Job(Submit) End*************************/ | |||
| message ParaStorQuotaReq{ | |||
| string username = 1; // @gotags: copier:"username" | |||
| } | |||
| message ParaStorQuotaResp{ | |||
| string Code = 1; // @gotags: copier:"Code" | |||
| string Msg = 2; // @gotags: copier:"Msg" | |||
| repeated QuotaData data = 3; // @gotags: copier:"Data" | |||
| } | |||
| message QuotaData{ | |||
| string username = 1; // @gotags: copier:"username" //用户名 | |||
| string path = 2; // @gotags: copier:"path" //共享存储配额路径 | |||
| double threshold = 3; // @gotags: copier:"threshold" //共享存储配额量,单位GB | |||
| double usage = 4; // @gotags: copier:"usage" //共享存储使用量,单位GB | |||
| } | |||
| message WallTimeReq{ | |||
| string username = 1; // @gotags: copier:"username" | |||
| } | |||
| message WallTimeResp{ | |||
| string Code = 1; // @gotags: copier:"Code" | |||
| string Msg = 2; // @gotags: copier:"Msg" | |||
| double data = 3; // @gotags: copier:"Data" | |||
| } | |||
| message QueueJobsReq{ | |||
| string userName = 1;//@gotags: copier:"userName" | |||
| } | |||
| message QueueJobsResp{ | |||
| string Code = 1; // @gotags: copier:"Code" | |||
| string Msg = 2; // @gotags: copier:"Msg" | |||
| repeated Queue data = 3; // @gotags: copier:"Data" | |||
| } | |||
| message Queue{ | |||
| string name = 1; // @gotags: copier:"name" | |||
| repeated Metric values = 2;// @gotags: copier:"values" | |||
| } | |||
| message Metric{ | |||
| string metricName = 1;// @gotags: copier:"metricName" | |||
| string metricValue = 2;// @gotags: copier:"metricValue" | |||
| } | |||
| message CpuCoreReq{ | |||
| } | |||
| message CpuCoreResp{ | |||
| string Code = 1; // @gotags: copier:"Code" | |||
| string Msg = 2; // @gotags: copier:"Msg" | |||
| repeated CpuCore data = 3; // @gotags: copier:"data" | |||
| } | |||
| message CpuCore{ | |||
| string name = 1; // @gotags: copier:"name" | |||
| int32 y = 2;// @gotags: copier:"y" | |||
| } | |||
| message JobsReq{ | |||
| string userName = 1; // @gotags: copier:"userName" | |||
| } | |||
| message JobsResp{ | |||
| string Code = 1; // @gotags: copier:"Code" | |||
| string Msg = 2; // @gotags: copier:"Msg" | |||
| repeated JobCore data = 3; // @gotags: copier:"data" | |||
| } | |||
| message JobCore{ | |||
| string name = 1; // @gotags: copier:"name" | |||
| int32 y = 2;// @gotags: copier:"y" | |||
| } | |||
| message HistoryJobDetailReq{ | |||
| string jobId = 1; | |||
| string jobmanagerId = 2; | |||
| string acctTime = 3; | |||
| } | |||
| message HistoryJobDetailResp { | |||
| string code = 1; | |||
| string msg = 2; | |||
| message data { | |||
| string acctTime = 1;// @gotags: copier:"acctTime" | |||
| string appType = 2; | |||
| string command = 3; | |||
| string commandExist = 4; | |||
| string cpuNuclearHour = 5; | |||
| string cpuNuclearSec = 6; | |||
| double cpuUnitPrice = 7; | |||
| string dcuCardHour = 8; | |||
| string dcuCardSec = 9; | |||
| double dcuUnitPrice = 10; | |||
| string efficiencyCpu = 11; | |||
| int64 exclusiveCputime = 12; | |||
| int64 exclusiveMem = 13; | |||
| int64 exclusiveWalltime = 14; | |||
| string goldenable = 15; | |||
| string gpuCardHour = 16; | |||
| string gpuCardSec = 17; | |||
| double gpuUnitPrice = 18; | |||
| string groupName = 19; | |||
| string historyAccount = 20; | |||
| string historyQueuerate = 21; | |||
| string isSinglejob = 22; | |||
| int64 jobCpuTime = 23; | |||
| int64 jobDcuNum = 24; | |||
| string jobEndTime = 25; | |||
| string jobExecGpus = 26; | |||
| string jobExecHost = 27; | |||
| int64 jobExitStatus = 28; | |||
| int64 jobGpuNum = 29; | |||
| string jobId = 30; | |||
| int64 jobMemUsed = 31; | |||
| string jobName = 32; | |||
| int64 jobProcNum = 33; | |||
| string jobQueueTime = 34; | |||
| double jobReqCpu = 35; | |||
| double jobReqDcu = 36; | |||
| double jobReqGpu = 37; | |||
| string jobReqMem = 38; | |||
| double jobReqNodes = 39; | |||
| int64 jobResponseTime = 40; | |||
| string jobStartTime = 41; | |||
| string jobState = 42; | |||
| int64 jobVmemUsed = 43; | |||
| int64 jobWaitTime = 44; | |||
| int64 jobWalltimeUsed = 45; | |||
| int64 jobmanagerId = 46; | |||
| string jobmanagerName = 47; | |||
| string needNodes = 48; | |||
| int64 nodect = 49; | |||
| string owner = 50; | |||
| string queue = 51; | |||
| string scale = 52; | |||
| int64 shareCputime = 53; | |||
| int64 shareMem = 54; | |||
| int64 shareWalltime = 55; | |||
| string startCount = 56; | |||
| string userName = 57; | |||
| int64 walltime = 58; | |||
| string workdir = 59; | |||
| } | |||
| } | |||
| message FileContentResp{ | |||
| string code = 1; // @gotags: copier:"Code" //状态码 示例:0 | |||
| string msg = 2; // @gotags: copier:"Msg" //信息 示例:success | |||
| @@ -397,13 +548,12 @@ service hpcAC { | |||
| // ListJobManager list all job managers | |||
| rpc ListJobManager(JobManagerReq) returns (ListJobManagerResp); | |||
| <<<<<<< HEAD | |||
| // GetJobDetail get job detail | |||
| rpc GetJobDetail(JobDetailReq) returns (GetJobDetailResp); | |||
| // DeleteJob delete job | |||
| rpc DeleteJob(DeleteJobReq) returns (DeleteJobResp); | |||
| ======= | |||
| //FileContent 查看文件内容 | |||
| rpc FileContent(FileDataReq) returns (FileContentResp); | |||
| @@ -415,5 +565,19 @@ service hpcAC { | |||
| ///QueryUserQuotasLimit 查询用户资源限制信息 | |||
| rpc QueryUserQuotasLimit(QueueReq) returns(UserQuotasLimitResp); | |||
| >>>>>>> ff7628a455a0eb264866e5bde762cd1c671eb8f3 | |||
| //ParaStor Quota | |||
| rpc ParaStorQuota(ParaStorQuotaReq) returns (ParaStorQuotaResp); | |||
| //WallTime | |||
| rpc WallTime(WallTimeReq) returns (WallTimeResp); | |||
| //QueueJobs | |||
| rpc QueueJobs(QueueJobsReq)returns (QueueJobsResp); | |||
| rpc CpuCore(CpuCoreReq) returns (CpuCoreResp); | |||
| rpc jobs(JobsReq) returns (JobsResp); | |||
| rpc HistoryJobDetail(HistoryJobDetailReq)returns (HistoryJobDetailResp); | |||
| } | |||
| @@ -3,11 +3,51 @@ package tool | |||
| import ( | |||
| "bytes" | |||
| "encoding/json" | |||
| "github.com/go-resty/resty/v2" | |||
| "io" | |||
| "io/ioutil" | |||
| "log" | |||
| "net/http" | |||
| "time" | |||
| ) | |||
| const ( | |||
| GET = "GET" | |||
| PUT = "PUT" | |||
| POST = "POST" | |||
| DELETE = "DELETE" | |||
| ) | |||
| const ( | |||
| ContentType = "Content-Type" | |||
| ApplicationJson = "application/json" | |||
| ) | |||
| func GetACHttpRequest() *resty.Request { | |||
| client := resty.New() | |||
| request := client.R() | |||
| return request | |||
| } | |||
| func HttpClient(method string, url string, payload io.Reader, token string) ([]byte, error) { | |||
| request, err := http.NewRequest(method, url, payload) | |||
| request.Header.Add("Content-Type", "application/json") | |||
| request.Header.Add("User-Agent", "API Explorer") | |||
| request.Header.Add("x-auth-token", token) | |||
| client := &http.Client{} | |||
| res, err := client.Do(request) | |||
| if err != nil { | |||
| log.Fatal(err) | |||
| } | |||
| defer res.Body.Close() | |||
| body, err := io.ReadAll(res.Body) | |||
| if err != nil { | |||
| log.Fatal(err) | |||
| } | |||
| return body, err | |||
| } | |||
| // 发送POST请求 | |||
| // url:请求地址,data:POST请求提交的数据,contentType:请求体格式,如:application/json | |||
| // content:请求放回的内容 | |||