diff --git a/api/desc/pcm.api b/api/desc/pcm.api index 89a40878..f4262a2a 100644 --- a/api/desc/pcm.api +++ b/api/desc/pcm.api @@ -300,4 +300,4 @@ service pcm { @handler GetLinkImageListHandler get /storelink/getImageList (GetLinkImageListReq) returns (GetLinkImageListResp) -} +} \ No newline at end of file diff --git a/api/internal/handler/routes.go b/api/internal/handler/routes.go index 6e95c52b..15b3ed4e 100644 --- a/api/internal/handler/routes.go +++ b/api/internal/handler/routes.go @@ -10,6 +10,7 @@ import ( hpc "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/hpc" image "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/image" storage "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/storage" + storelink "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/storelink" vm "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/vm" "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc" @@ -458,4 +459,20 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { }, rest.WithPrefix("/pcm/v1"), ) + + server.AddRoutes( + []rest.Route{ + { + Method: http.MethodPost, + Path: "/storelink/uploadImage", + Handler: storelink.UploadLinkImageHandler(serverCtx), + }, + { + Method: http.MethodGet, + Path: "/storelink/getImageList", + Handler: storelink.GetLinkImageListHandler(serverCtx), + }, + }, + rest.WithPrefix("/pcm/v1"), + ) } diff --git a/api/internal/pkg/scheduler/cloudScheduler.go b/api/internal/pkg/scheduler/cloudScheduler.go index b17fd854..2d9190ef 100644 --- a/api/internal/pkg/scheduler/cloudScheduler.go +++ b/api/internal/pkg/scheduler/cloudScheduler.go @@ -79,6 +79,10 @@ func (cs *cloudScheduler) UnMarshalK8sStruct(yamlString string, taskId int64) mo Namespace: unstructureObj.GetNamespace(), Status: "Saved", } + // 命名空间为空 设置默认值 + if len(unstructureObj.GetNamespace()) == 0 { + cloud.Namespace = "default" + } } return cloud } diff --git a/api/internal/types/types.go b/api/internal/types/types.go index 7190e7a7..a467d806 100644 --- a/api/internal/types/types.go +++ b/api/internal/types/types.go @@ -2719,3 +2719,17 @@ type Cloud struct { CreatedTime string `json:"createdTime"` // 创建时间 Result string `json:"result"` } + +type UploadLinkImageReq struct { +} + +type UploadLinkImageImageResp struct { +} + +type GetLinkImageListReq struct { + PartId int64 `json:"partId"` +} + +type GetLinkImageListResp struct { + ImageIds []int64 `json:"imageIds"` +}