From ab09dd6d28fa7a2091a91637ed1b26f8ae00a74e Mon Sep 17 00:00:00 2001 From: qiwang <1364512070@qq.com> Date: Thu, 15 Jun 2023 08:54:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:PCM-CORE=E4=BB=A3=E7=A0=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: d1d24100e36b1427586f69e1110513d9a63e5e45 --- adaptor/PCM-CORE/api/desc/ai/pcm-ai.api | 22 +++--- adaptor/PCM-CORE/api/desc/pcm.api | 2 +- .../PCM-CORE/api/internal/handler/routes.go | 2 +- adaptor/PCM-CORE/api/internal/types/types.go | 74 ++++++++++++++----- 4 files changed, 70 insertions(+), 30 deletions(-) diff --git a/adaptor/PCM-CORE/api/desc/ai/pcm-ai.api b/adaptor/PCM-CORE/api/desc/ai/pcm-ai.api index 0db6f62a..1dfa4af0 100644 --- a/adaptor/PCM-CORE/api/desc/ai/pcm-ai.api +++ b/adaptor/PCM-CORE/api/desc/ai/pcm-ai.api @@ -700,7 +700,7 @@ type ( ProjectId string `path:"projectId"` ServiceId string `path:"serviceId"` /****************智算类型 ModelartsType parmas ********************/ - ModelArtsType string `json:"modelartsType,optional"` + ModelArtsType string `form:"modelArtsType,optional"` } ) @@ -719,11 +719,11 @@ type ( Limit int32 `form:"limit,optional"` Offset int32 `form:"offSet,optional"` /****************智算类型 ModelartsType parmas ********************/ - ModelArtsType string `json:"modelartsType,optional"` + ModelArtsType string `form:"modelArtsType,optional"` } ) type ListServicesResp { - TotalCount int32 `json:"totalCount,omitempty" copier:"TotalCount"` + TotalCount int32 `json:"total,omitempty" copier:"TotalCount"` Count int32 `json:"count,omitempty" copier:"Count"` Services []ListServices `json:"services,omitempty" copier:"Services"` Code int32 `json:"code,omitempty"` @@ -1149,7 +1149,7 @@ type ( ProjectId string `json:"projectId" copier:"ProjectId"` Param ListNotebookParam `json:"param,optional" copier:"Param"` /****************智算类型 ModelartsType parmas ********************/ - ModelArtsType string `json:"modelartsType,optional"` + ModelArtsType string `json:"modelArtsType,optional"` } ListNotebookResp { Current int32 `json:"current,omitempty" copier:"Current"` @@ -1177,7 +1177,7 @@ type ( ProjectId string `json:"projectId" copier:"ProjectId"` Param CreateNotebookParam `json:"param" copier:"Param"` /****************智算类型 ModelartsType parmas ********************/ - ModelArtsType string `json:"modelartsType,optional"` + ModelArtsType string `json:"modelArtsType,optional"` } CreateNotebookResp { NotebookResp *NotebookResp `json:"notebookResp,omitempty" copier:"NotebookResp"` @@ -1205,7 +1205,7 @@ type ( ProjectId string `json:"projectId" copier:"ProjectId"` Param StartNotebookParam `json:"param" copier:"Param"` /****************智算类型 ModelartsType parmas ********************/ - ModelArtsType string `json:"modelartsType,optional"` + ModelArtsType string `json:"modelArtsType,optional"` } StartNotebookResp { NotebookResp NotebookResp `json:"notebookResp" copier:"NotebookResp"` @@ -1222,7 +1222,7 @@ type ( Id string `json:"id" copier:"Id"` ProjectId string `json:"projectId" copier:"ProjectId"` /****************智算类型 ModelartsType parmas ********************/ - ModelArtsType string `json:"modelartsType,optional"` + ModelArtsType string `json:"modelArtsType,optional"` } StopNotebookResp { NotebookResp NotebookResp `json:"notebookResp" copier:"NotebookResp"` @@ -1235,7 +1235,7 @@ type ( InstanceId string `json:"instanceId" copier:"InstanceId"` ProjectId string `json:"projectId" copier:"ProjectId"` /****************智算类型 ModelartsType parmas ********************/ - ModelArtsType string `json:"modelartsType,optional"` + ModelArtsType string `json:"modelArtsType,optional"` } GetNotebookStorageResp { Current int32 `json:"current" copier:"Current"` @@ -1249,7 +1249,7 @@ type ( ProjectId string `json:"projectId" copier:"ProjectId"` Param MountNotebookStorageParam `json:"param" copier:"Param"` /****************智算类型 ModelartsType parmas ********************/ - ModelArtsType string `json:"modelartsType,optional"` + ModelArtsType string `json:"modelArtsType,optional"` } MountNotebookStorageResp { Category string `json:"category" copier:"Category"` @@ -1436,7 +1436,7 @@ type ( Project_id string `json:"projectId"` Param GetVisualizationJobParam `json:"param"` /****************智算类型 ModelartsType parmas ********************/ - ModelArtsType string `json:"modelartsType,optional"` + ModelArtsType string `json:"modelArtsType,optional"` } GetVisualizationJobResp { Is_success bool `json:"isSuccess"` @@ -1471,7 +1471,7 @@ type ( Project_id string `json:"projectId"` Param CreateVisualizationJobParam `json:"param"` /****************智算类型 ModelartsType parmas ********************/ - ModelArtsType string `json:"modelartsType,optional"` + ModelArtsType string `json:"modelArtsType,optional"` } CreateVisualizationJobResp { Error_message string `json:"errorMessage"` diff --git a/adaptor/PCM-CORE/api/desc/pcm.api b/adaptor/PCM-CORE/api/desc/pcm.api index 0b7434bc..61388b04 100644 --- a/adaptor/PCM-CORE/api/desc/pcm.api +++ b/adaptor/PCM-CORE/api/desc/pcm.api @@ -137,7 +137,7 @@ service pcm { get /ai/ShowService/:projectId/:serviceId (ShowServiceReq) returns (ShowServiceResp) // Delete service 删除服务 @handler DeleteServiceHandler - delete /ai/DeleteService (DeleteServiceReq) returns (DeleteServiceResp) + delete /ai/DeleteService/:projectId/:serviceId (DeleteServiceReq) returns (DeleteServiceResp) // ListClusters查询专属资源池列表 @handler ListClustersHandler get /ai/ListClusters (ListClustersReq) returns (ListClustersResp) diff --git a/adaptor/PCM-CORE/api/internal/handler/routes.go b/adaptor/PCM-CORE/api/internal/handler/routes.go index 7c999485..46377e0c 100644 --- a/adaptor/PCM-CORE/api/internal/handler/routes.go +++ b/adaptor/PCM-CORE/api/internal/handler/routes.go @@ -196,7 +196,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { }, { Method: http.MethodDelete, - Path: "/ai/DeleteService", + Path: "/ai/DeleteService/:projectId/:serviceId", Handler: ai.DeleteServiceHandler(serverCtx), }, { diff --git a/adaptor/PCM-CORE/api/internal/types/types.go b/adaptor/PCM-CORE/api/internal/types/types.go index 7f4f7437..045dcd9e 100644 --- a/adaptor/PCM-CORE/api/internal/types/types.go +++ b/adaptor/PCM-CORE/api/internal/types/types.go @@ -983,7 +983,7 @@ type CustomSpec struct { type DeleteServiceReq struct { ProjectId string `path:"projectId"` ServiceId string `path:"serviceId"` - ModelArtsType string `json:"modelartsType,optional"` + ModelArtsType string `form:"modelArtsType,optional"` } type DeleteServiceResp struct { @@ -996,11 +996,11 @@ type ListServicesReq struct { ProjectId string `path:"projectId"` Limit int32 `form:"limit,optional"` Offset int32 `form:"offSet,optional"` - ModelArtsType string `json:"modelartsType,optional"` + ModelArtsType string `form:"modelArtsType,optional"` } type ListServicesResp struct { - TotalCount int32 `json:"totalCount,omitempty" copier:"TotalCount"` + TotalCount int32 `json:"total,omitempty" copier:"TotalCount"` Count int32 `json:"count,omitempty" copier:"Count"` Services []ListServices `json:"services,omitempty" copier:"Services"` Code int32 `json:"code,omitempty"` @@ -1382,7 +1382,7 @@ type DeleteDataSetResp struct { type ListNotebookReq struct { ProjectId string `json:"projectId" copier:"ProjectId"` Param ListNotebookParam `json:"param,optional" copier:"Param"` - ModelArtsType string `json:"modelartsType,optional"` + ModelArtsType string `json:"modelArtsType,optional"` } type ListNotebookResp struct { @@ -1412,7 +1412,7 @@ type ListNotebookParam struct { type CreateNotebookReq struct { ProjectId string `json:"projectId" copier:"ProjectId"` Param CreateNotebookParam `json:"param" copier:"Param"` - ModelArtsType string `json:"modelartsType,optional"` + ModelArtsType string `json:"modelArtsType,optional"` } type CreateNotebookResp struct { @@ -1441,7 +1441,7 @@ type StartNotebookReq struct { Id string `json:"id" copier:"Id"` ProjectId string `json:"projectId" copier:"ProjectId"` Param StartNotebookParam `json:"param" copier:"Param"` - ModelArtsType string `json:"modelartsType,optional"` + ModelArtsType string `json:"modelArtsType,optional"` } type StartNotebookResp struct { @@ -1459,7 +1459,7 @@ type StartNotebookParam struct { type StopNotebookReq struct { Id string `json:"id" copier:"Id"` ProjectId string `json:"projectId" copier:"ProjectId"` - ModelArtsType string `json:"modelartsType,optional"` + ModelArtsType string `json:"modelArtsType,optional"` } type StopNotebookResp struct { @@ -1472,7 +1472,7 @@ type StopNotebookResp struct { type GetNotebookStorageReq struct { InstanceId string `json:"instanceId" copier:"InstanceId"` ProjectId string `json:"projectId" copier:"ProjectId"` - ModelArtsType string `json:"modelartsType,optional"` + ModelArtsType string `json:"modelArtsType,optional"` } type GetNotebookStorageResp struct { @@ -1487,7 +1487,7 @@ type MountNotebookStorageReq struct { InstanceId string `json:"instanceId" copier:"InstanceId"` ProjectId string `json:"projectId" copier:"ProjectId"` Param MountNotebookStorageParam `json:"param" copier:"Param"` - ModelArtsType string `json:"modelartsType,optional"` + ModelArtsType string `json:"modelArtsType,optional"` } type MountNotebookStorageResp struct { @@ -1668,7 +1668,7 @@ type LeaseReq struct { type GetVisualizationJobReq struct { Project_id string `json:"projectId"` Param GetVisualizationJobParam `json:"param"` - ModelArtsType string `json:"modelartsType,optional"` + ModelArtsType string `json:"modelArtsType,optional"` } type GetVisualizationJobResp struct { @@ -1706,7 +1706,7 @@ type GetVisualizationJobParam struct { type CreateVisualizationJobReq struct { Project_id string `json:"projectId"` Param CreateVisualizationJobParam `json:"param"` - ModelArtsType string `json:"modelartsType,optional"` + ModelArtsType string `json:"modelArtsType,optional"` } type CreateVisualizationJobResp struct { @@ -1781,10 +1781,8 @@ type ConstraintCreateTraining struct { } type ParametersTrainJob struct { - Name string `json:"name,optional"` - Description string `json:"description,optional"` - Value string `json:"value,optional"` - ConstraintCreateTraining ConstraintCreateTraining `json:"constraint,optional"` + Name string `json:"name,optional"` + Value string `json:"value,optional"` } type PoliciesCreateTraining struct { @@ -1799,11 +1797,53 @@ type AlgorithmsCtRq struct { ParametersTrainJob []ParametersTrainJob `json:"parameters,optional"` PoliciesCreateTraining PoliciesCreateTraining `json:"policies,optional"` Command string `json:"command,optional"` + SubscriptionId string `json:"subscriptionId,optional"` + ItemVersionId string `json:"itemVersionId,optional"` + InputTra []InputTra `json:"inputs,optional"` + OutputTra []OutputTra `json:"outputs,optional"` + Environments Environments `json:"environments,optional"` +} + +type Environments struct { +} + +type InputTra struct { + Name string `json:"name,optional"` + AccessMethod string `json:"accessMethod,optional"` + RemoteIn RemoteTra `json:"remoteIn,optional"` +} + +type RemoteTra struct { + DatasetIn DatasetTra `json:"dataSet,optional"` +} + +type DatasetTra struct { + Id string `json:"id,optional"` + Name string `json:"name,optional"` + VersionName string `json:"versionName,optional"` + VersionId string `json:"versionId,optional"` +} + +type OutputTra struct { + Name string `json:"name,optional"` + AccessMethod string `json:"accessMethod,optional"` + PrefetchToLocal string `json:"prefetchToLocal,optional"` + RemoteOut RemoteOut `json:"remoteOut,optional"` +} + +type RemoteOut struct { + Obs ObsTra `json:"obs,optional"` +} + +type ObsTra struct { + ObsUrl string `json:"obsUrl,optional"` } type ResourceCreateTraining struct { - FlavorId string `json:"flavorId,optional"` - NodeCount int32 `json:"nodeCount,optional"` + FlavorId string `json:"flavorId,optional"` + NodeCount int32 `json:"nodeCount,optional"` + Policy string `json:"policy,optional"` + FlavorLabel string `json:"flavorLabel,optional"` } type LogExportPathCreateTrainingJob struct {