api code generate

Former-commit-id: 31d1d48b7ca4d25d5f71eac862ce9da7cd6d1320
This commit is contained in:
zhouqunjie 2023-10-24 11:04:56 +08:00
parent 3f5950b7c6
commit 4a3df1b22a
8 changed files with 127 additions and 84 deletions

View File

@ -26,66 +26,66 @@ info(
service pcm {
@handler participantListHandler
get /core/participantList returns (participantListResp)
@handler scheduleTaskByYamlHandler
post /core/scheduleTaskByYaml (scheduleTaskByYamlReq) returns (scheduleTaskByYamlResp)
@handler deleteTaskHandler
delete /core/deleteTask/:id (deleteTaskReq)
@handler scheduleTaskHandler
post /core/scheduleTask (scheduleTaskReq)
// 任务列表接口
@handler TaskListHandler
get /core/taskList (taskListReq)returns (taskListResp)
// 任务详情接口
@handler TaskDetailHandler
get /core/taskDetail (taskDetailReq) returns (taskDetailResp)
@handler JobTotalHandler
get /core/jobTotal returns (jobTotalResp)
@handler listCenterHandler
get /core/listCenter returns (listCenterResp)
@handler listClusterHandler
get /core/listCluster/:centerId (listClusterReq) returns (listClusterResp)
@handler submitJobHandler
post /core/submitJob (submitJobReq) returns (submitJobResp)
@handler getRegionHandler
get /core/getRegion returns (getRegionResp)
@handler listRegionHandler
get /core/listRegion returns (listRegionResp)
@handler getComputingPowerHandler
get /core/getComputingPower returns (cpResp)
@handler getGeneralInfoHandler
get /core/getGeneralInfo returns (GiResp)
@handler listDomainResourceHandler
get /core/listDomainResource returns (DomainResourceResp)
@handler getResourcePanelConfigHandler
get /core/getResourcePanelConfigHandler returns (ResourcePanelConfigResp)
@handler putResourcePanelConfigHandler
put /core/resourcePanelConfigHandler (ResourcePanelConfigReq)
@handler getComputilityStatisticsHandler
get /core/getComputilityStatistics returns (ComputilityStatisticsResp)
@handler nodeAssetsHandler
get /core/assets returns (NodeAssetsResp)
@handler saveHashcatHandler
post /core/saveHashcat (SaveHashcatReq)
@handler getHashcatHandler
get /core/getHashcat/:crackTaskId (getHashcatHandlerReq) returns (getHashcatHandlerResp)
}
@ -98,10 +98,10 @@ service pcm {
service pcm {
@handler listJobHandler
get /hpc/listJob (listJobReq) returns (listJobResp)
@handler listHistoryJobHandler
get /hpc/listHistoryJob (listHistoryJobReq) returns (listHistoryJobResp)
@handler queueAssetsHandler
get /queue/assets returns (QueueAssetsResp)
}
@ -114,7 +114,7 @@ service pcm {
service pcm {
@handler cloudListHandler
get /task/list returns (cloudListResp)
@handler deleteYamlHandler
get /cloud/DeleteYaml (ApplyReq) returns (DeleteResp)
}
@ -127,10 +127,10 @@ service pcm {
service pcm {
@handler listDataSetHandler
get /ai/listDataSet/:projectId (DataSetReq) returns (DataSetResp)
@handler CreateDataSetHandler
post /ai/createDataSet/:projectId (CreateDataSetReq) returns (CreateDataSetResp)
@handler DeleteDataSetHandler
delete /ai/deleteDataSet/:projectId/:datasetId (DeleteDataSetReq) returns (DeleteDataSetResp)
// creat task 创建导入任务
@ -161,7 +161,7 @@ service pcm {
// ShowAlgorithmByUuid 展示算法详情
@handler ShowAlgorithmByUuid
get /ai/ShowAlgorithmByUuid/:projectId/:algorithmId (ShowAlgorithmByUuidReq) returns (ShowAlgorithmByUuidResp)
// creat export task 创建导出任务
@handler CreateExportTaskHandler
post /ai/CreateExportTask/:projectId/:datasetId (CreateExportTaskReq) returns (ExportTaskDataResp)
@ -169,11 +169,11 @@ service pcm {
get /ai/GetExportTasksOfDataset/:projectId/:datasetId (GetExportTasksOfDatasetReq) returns (GetExportTasksOfDatasetResp)
@handler GetExportTaskStatusOfDatasetHandler
get /ai/GetExportTaskStatusOfDataset/:projectId/:resourceId/:taskId (GetExportTaskStatusOfDatasetReq) returns (GetExportTaskStatusOfDatasetResp)
// create processor task 创建处理任务
@handler CreateProcessorTaskHandler
post /ai/CreateProcessorTask (CreateProcessorTaskReq) returns (CreateProcessorTaskResp)
// create service 创建服务
@handler CreateServiceHandler
post /ai/CreateService/:projectId (CreateServiceReq) returns (CreateServiceResp)
@ -189,7 +189,7 @@ service pcm {
// ListClusters查询专属资源池列表
@handler ListClustersHandler
get /ai/ListClusters (ListClustersReq) returns (ListClustersResp)
/******************Notebook Method start*************************/
@handler listNotebookHandler
get /ai/listNotebook (ListNotebookReq) returns (ListNotebookResp)
@ -204,7 +204,7 @@ service pcm {
@handler mountNotebookStorageHandler
post /ai/mountNotebookStorage (MountNotebookStorageReq) returns (MountNotebookStorageResp)
/******************Notebook Method end*************************/
/******************Visualization Job Method start*************************/
@handler getVisualizationJobHandler
get /ai/getVisualizationJob (GetVisualizationJobReq) returns (GetVisualizationJobResp)
@ -235,16 +235,16 @@ service pcm {
service pcm {
@handler uploadHandler
post /upload
@handler chunkHandler
post /chunk
@handler imageListHandler
get /image/list returns (imageListResp)
@handler dataSetCheckHandler
get /dataSet/check/:fileMd5 (checkReq) returns (checkResp)
@handler uploadDataSetHandler
post /dataSet/upload
}
@ -290,7 +290,7 @@ service pcm {
post /vm/createImage (CreateImageReq) returns (CreateImageResp)
@handler UploadImageHandler
put /vm/uploadImage (UploadOsImageReq) returns (UploadOsImageResp)
/*网络*/
@handler ListNetworksHandler
get /vm/listNetworks (ListNetworksReq) returns (ListNetworksResp)
@ -306,7 +306,7 @@ service pcm {
put /vm/updateNetwork (UpdateNetworkReq) returns (UpdateNetworkResp)
@handler BulkCreateNetworksHandler
post /vm/bulkCreateNetworks (BulkCreateNetworksReq) returns (BulkCreateNetworksResp)
/*卷*/
@handler ListVolumesDetailHandler
get /vm/listVolumesDetail (ListVolumesDetailReq) returns (ListVolumesDetailResp)
@ -328,7 +328,7 @@ service pcm {
get /vm/listVolumes (ListVolumesReq) returns (ListVolumesResp)
@handler GetVolumeDetailedByIdHandler
get /vm/getVolumeDetailedById (GetVolumeDetailedByIdReq) returns (GetVolumeDetailedByIdResp)
// Bare Metal
@handler ListNodesHandler
get /vm/listNodes (ListNodesReq) returns (ListNodesResp)
@ -349,25 +349,25 @@ service pcm {
service pcm {
@handler UploadLinkImageHandler
post /storelink/uploadImage (UploadLinkImageReq) returns (UploadLinkImageResp)
@handler GetLinkImageListHandler
get /storelink/getImageList (GetLinkImageListReq) returns (GetLinkImageListResp)
@handler DeleteLinkImageHandler
delete /storelink/deleteImage (DeleteLinkImageReq) returns (DeleteLinkImageResp)
@handler SubmitLinkTaskHandler
post /storelink/submitTask (SubmitLinkTaskReq) returns (SubmitLinkTaskResp)
@handler GetLinkTaskHandler
get /storelink/getTask (GetLinkTaskReq) returns (GetLinkTaskResp)
@handler DeleteLinkTaskHandler
delete /storelink/deleteTask (DeleteLinkTaskReq) returns (DeleteLinkTaskResp)
@handler GetParticipantsHandler
get /storelink/getParticipants (GetParticipantsReq) returns (GetParticipantsResp)
@handler GetAISpecsHandler
get /storelink/getResourceSpecs (GetResourceSpecsReq) returns (GetResourceSpecsResp)
}

View File

@ -0,0 +1,28 @@
package core
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/logic/core"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
)
func TaskListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.TaskListReq
if err := httpx.Parse(r, &req); err != nil {
httpx.ErrorCtx(r.Context(), w, err)
return
}
l := core.NewTaskListLogic(r.Context(), svcCtx)
resp, err := l.TaskList(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
}
}

View File

@ -0,0 +1,30 @@
package core
import (
"context"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type TaskListLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewTaskListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *TaskListLogic {
return &TaskListLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *TaskListLogic) TaskList(req *types.TaskListReq) (resp *types.TaskListResp, err error) {
// todo: add your logic here and delete this line
return
}

View File

@ -3441,6 +3441,7 @@ type GetParticipantsResp struct {
}
type GetResourceSpecsReq struct {
PartId int64 `json:"partId"`
}
type GetResourceSpecsResp struct {

View File

@ -1,7 +1,7 @@
// Code generated by goctl. DO NOT EDIT.
// Source: pcmCore.proto
package participantservice
package client
import (
"context"

View File

@ -1,7 +1,7 @@
// Code generated by goctl. DO NOT EDIT.
// Source: pcmCore.proto
package pcmcore
package client
import (
"context"

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.30.0
// protoc-gen-go v1.31.0
// protoc v3.19.4
// source: pcmCore.proto

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.19.4
// source: pcmCore.proto
@ -18,11 +18,6 @@ import (
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
PcmCore_SyncInfo_FullMethodName = "/pcmCore.pcmCore/SyncInfo"
PcmCore_InfoList_FullMethodName = "/pcmCore.pcmCore/InfoList"
)
// PcmCoreClient is the client API for PcmCore service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
@ -43,7 +38,7 @@ func NewPcmCoreClient(cc grpc.ClientConnInterface) PcmCoreClient {
func (c *pcmCoreClient) SyncInfo(ctx context.Context, in *SyncInfoReq, opts ...grpc.CallOption) (*SyncInfoResp, error) {
out := new(SyncInfoResp)
err := c.cc.Invoke(ctx, PcmCore_SyncInfo_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, "/pcmCore.pcmCore/SyncInfo", in, out, opts...)
if err != nil {
return nil, err
}
@ -52,7 +47,7 @@ func (c *pcmCoreClient) SyncInfo(ctx context.Context, in *SyncInfoReq, opts ...g
func (c *pcmCoreClient) InfoList(ctx context.Context, in *InfoListReq, opts ...grpc.CallOption) (*InfoListResp, error) {
out := new(InfoListResp)
err := c.cc.Invoke(ctx, PcmCore_InfoList_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, "/pcmCore.pcmCore/InfoList", in, out, opts...)
if err != nil {
return nil, err
}
@ -103,7 +98,7 @@ func _PcmCore_SyncInfo_Handler(srv interface{}, ctx context.Context, dec func(in
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: PcmCore_SyncInfo_FullMethodName,
FullMethod: "/pcmCore.pcmCore/SyncInfo",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PcmCoreServer).SyncInfo(ctx, req.(*SyncInfoReq))
@ -121,7 +116,7 @@ func _PcmCore_InfoList_Handler(srv interface{}, ctx context.Context, dec func(in
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: PcmCore_InfoList_FullMethodName,
FullMethod: "/pcmCore.pcmCore/InfoList",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PcmCoreServer).InfoList(ctx, req.(*InfoListReq))
@ -149,17 +144,6 @@ var PcmCore_ServiceDesc = grpc.ServiceDesc{
Metadata: "pcmCore.proto",
}
const (
ParticipantService_RegisterParticipant_FullMethodName = "/pcmCore.participantService/registerParticipant"
ParticipantService_ReportHeartbeat_FullMethodName = "/pcmCore.participantService/reportHeartbeat"
ParticipantService_ReportAvailable_FullMethodName = "/pcmCore.participantService/reportAvailable"
ParticipantService_ListParticipant_FullMethodName = "/pcmCore.participantService/listParticipant"
ParticipantService_ListPhyAvailable_FullMethodName = "/pcmCore.participantService/listPhyAvailable"
ParticipantService_ListPhyInformation_FullMethodName = "/pcmCore.participantService/listPhyInformation"
ParticipantService_RegisterTenant_FullMethodName = "/pcmCore.participantService/registerTenant"
ParticipantService_ListTenant_FullMethodName = "/pcmCore.participantService/listTenant"
)
// ParticipantServiceClient is the client API for ParticipantService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
@ -192,7 +176,7 @@ func NewParticipantServiceClient(cc grpc.ClientConnInterface) ParticipantService
func (c *participantServiceClient) RegisterParticipant(ctx context.Context, in *ParticipantPhyReq, opts ...grpc.CallOption) (*ParticipantPhyResp, error) {
out := new(ParticipantPhyResp)
err := c.cc.Invoke(ctx, ParticipantService_RegisterParticipant_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, "/pcmCore.participantService/registerParticipant", in, out, opts...)
if err != nil {
return nil, err
}
@ -201,7 +185,7 @@ func (c *participantServiceClient) RegisterParticipant(ctx context.Context, in *
func (c *participantServiceClient) ReportHeartbeat(ctx context.Context, in *ParticipantHeartbeatReq, opts ...grpc.CallOption) (*HealthCheckResp, error) {
out := new(HealthCheckResp)
err := c.cc.Invoke(ctx, ParticipantService_ReportHeartbeat_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, "/pcmCore.participantService/reportHeartbeat", in, out, opts...)
if err != nil {
return nil, err
}
@ -210,7 +194,7 @@ func (c *participantServiceClient) ReportHeartbeat(ctx context.Context, in *Part
func (c *participantServiceClient) ReportAvailable(ctx context.Context, in *ParticipantAvailReq, opts ...grpc.CallOption) (*ParticipantResp, error) {
out := new(ParticipantResp)
err := c.cc.Invoke(ctx, ParticipantService_ReportAvailable_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, "/pcmCore.participantService/reportAvailable", in, out, opts...)
if err != nil {
return nil, err
}
@ -219,7 +203,7 @@ func (c *participantServiceClient) ReportAvailable(ctx context.Context, in *Part
func (c *participantServiceClient) ListParticipant(ctx context.Context, in *ParticipantTenant, opts ...grpc.CallOption) (*ParticipantServiceResp, error) {
out := new(ParticipantServiceResp)
err := c.cc.Invoke(ctx, ParticipantService_ListParticipant_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, "/pcmCore.participantService/listParticipant", in, out, opts...)
if err != nil {
return nil, err
}
@ -228,7 +212,7 @@ func (c *participantServiceClient) ListParticipant(ctx context.Context, in *Part
func (c *participantServiceClient) ListPhyAvailable(ctx context.Context, in *ParticipantTenant, opts ...grpc.CallOption) (*ListParticipantAvailResp, error) {
out := new(ListParticipantAvailResp)
err := c.cc.Invoke(ctx, ParticipantService_ListPhyAvailable_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, "/pcmCore.participantService/listPhyAvailable", in, out, opts...)
if err != nil {
return nil, err
}
@ -237,7 +221,7 @@ func (c *participantServiceClient) ListPhyAvailable(ctx context.Context, in *Par
func (c *participantServiceClient) ListPhyInformation(ctx context.Context, in *ParticipantTenant, opts ...grpc.CallOption) (*ListParticipantPhyResp, error) {
out := new(ListParticipantPhyResp)
err := c.cc.Invoke(ctx, ParticipantService_ListPhyInformation_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, "/pcmCore.participantService/listPhyInformation", in, out, opts...)
if err != nil {
return nil, err
}
@ -246,7 +230,7 @@ func (c *participantServiceClient) ListPhyInformation(ctx context.Context, in *P
func (c *participantServiceClient) RegisterTenant(ctx context.Context, in *TenantInfo, opts ...grpc.CallOption) (*TenantResp, error) {
out := new(TenantResp)
err := c.cc.Invoke(ctx, ParticipantService_RegisterTenant_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, "/pcmCore.participantService/registerTenant", in, out, opts...)
if err != nil {
return nil, err
}
@ -255,7 +239,7 @@ func (c *participantServiceClient) RegisterTenant(ctx context.Context, in *Tenan
func (c *participantServiceClient) ListTenant(ctx context.Context, in *TenantInfo, opts ...grpc.CallOption) (*ListTenantResp, error) {
out := new(ListTenantResp)
err := c.cc.Invoke(ctx, ParticipantService_ListTenant_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, "/pcmCore.participantService/listTenant", in, out, opts...)
if err != nil {
return nil, err
}
@ -336,7 +320,7 @@ func _ParticipantService_RegisterParticipant_Handler(srv interface{}, ctx contex
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ParticipantService_RegisterParticipant_FullMethodName,
FullMethod: "/pcmCore.participantService/registerParticipant",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ParticipantServiceServer).RegisterParticipant(ctx, req.(*ParticipantPhyReq))
@ -354,7 +338,7 @@ func _ParticipantService_ReportHeartbeat_Handler(srv interface{}, ctx context.Co
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ParticipantService_ReportHeartbeat_FullMethodName,
FullMethod: "/pcmCore.participantService/reportHeartbeat",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ParticipantServiceServer).ReportHeartbeat(ctx, req.(*ParticipantHeartbeatReq))
@ -372,7 +356,7 @@ func _ParticipantService_ReportAvailable_Handler(srv interface{}, ctx context.Co
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ParticipantService_ReportAvailable_FullMethodName,
FullMethod: "/pcmCore.participantService/reportAvailable",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ParticipantServiceServer).ReportAvailable(ctx, req.(*ParticipantAvailReq))
@ -390,7 +374,7 @@ func _ParticipantService_ListParticipant_Handler(srv interface{}, ctx context.Co
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ParticipantService_ListParticipant_FullMethodName,
FullMethod: "/pcmCore.participantService/listParticipant",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ParticipantServiceServer).ListParticipant(ctx, req.(*ParticipantTenant))
@ -408,7 +392,7 @@ func _ParticipantService_ListPhyAvailable_Handler(srv interface{}, ctx context.C
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ParticipantService_ListPhyAvailable_FullMethodName,
FullMethod: "/pcmCore.participantService/listPhyAvailable",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ParticipantServiceServer).ListPhyAvailable(ctx, req.(*ParticipantTenant))
@ -426,7 +410,7 @@ func _ParticipantService_ListPhyInformation_Handler(srv interface{}, ctx context
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ParticipantService_ListPhyInformation_FullMethodName,
FullMethod: "/pcmCore.participantService/listPhyInformation",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ParticipantServiceServer).ListPhyInformation(ctx, req.(*ParticipantTenant))
@ -444,7 +428,7 @@ func _ParticipantService_RegisterTenant_Handler(srv interface{}, ctx context.Con
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ParticipantService_RegisterTenant_FullMethodName,
FullMethod: "/pcmCore.participantService/registerTenant",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ParticipantServiceServer).RegisterTenant(ctx, req.(*TenantInfo))
@ -462,7 +446,7 @@ func _ParticipantService_ListTenant_Handler(srv interface{}, ctx context.Context
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ParticipantService_ListTenant_FullMethodName,
FullMethod: "/pcmCore.participantService/listTenant",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ParticipantServiceServer).ListTenant(ctx, req.(*TenantInfo))