diff --git a/api/desc/pcm.api b/api/desc/pcm.api index 7303f98a..0cf9af1d 100644 --- a/api/desc/pcm.api +++ b/api/desc/pcm.api @@ -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) } \ No newline at end of file diff --git a/api/desc/vm/pcm-vm.api b/api/desc/vm/pcm-vm.api index e301f62f..bf40af2c 100644 --- a/api/desc/vm/pcm-vm.api +++ b/api/desc/vm/pcm-vm.api @@ -236,7 +236,8 @@ type( type ( StartServerReq { ServerId string `json:"server_id" copier:"ServerId"` - OsStart OsStart `json:"osStart" copier:"OsStart"` + Action []map[string]string `json:"Action,optional" copier:"Action"` + start_action string `json:"start_action" copier:"start_action"` } StartServerResp { @@ -244,29 +245,24 @@ type ( ErrorMsg string `json:"errorMsg,omitempty"` Code int32 `json:"code,omitempty"` } - OsStart { - os_start string `json:"os_start" copier:"os_start"` - } ) type( StopServerReq{ ServerId string `json:"server_id" copier:"ServerId"` - OsStart OsStart `json:"os_start" copier:"OsStart"` + Action []map[string]string `json:"Action,optional" copier:"Action"` + stop_action string `json:"stop_action" copier:"stop_action"` } StopServerResp { Msg string `json:"msg,omitempty"` ErrorMsg string `json:"errorMsg,omitempty"` Code int32 `json:"code,omitempty"` } - OsStop { - OsStop string `json:"os_stop" copier:"OsStop"` - } ) type( RebootServerReq{ ServerId string `json:"server_id" copier:"ServerId"` - OsStart OsStart `json:"os_start" copier:"OsStart"` + Reboot Reboot `json:"reboot" copier:"Reboot"` } RebootServerResp { Msg string `json:"msg,omitempty"` @@ -280,16 +276,14 @@ type( type( PauseServerReq{ ServerId string `json:"server_id" copier:"ServerId"` - OsStart OsStart `json:"os_start" copier:"OsStart"` + Action []map[string]string `json:"Action,optional" copier:"Action"` + pause_action string `json:"pause_action" copier:"pause_action"` } PauseServerResp { Msg string `json:"msg,omitempty"` ErrorMsg string `json:"errorMsg,omitempty"` Code int32 `json:"code,omitempty"` } - OsPause { - Pause string `json:"pause" copier:"Pause"` - } ) type ( diff --git a/api/internal/types/types.go b/api/internal/types/types.go index aa275a6a..87465b78 100644 --- a/api/internal/types/types.go +++ b/api/internal/types/types.go @@ -2415,8 +2415,9 @@ type UpdateServerResp struct { } type StartServerReq struct { - ServerId string `json:"server_id" copier:"ServerId"` - OsStart OsStart `json:"osStart" copier:"OsStart"` + ServerId string `json:"server_id" copier:"ServerId"` + Action []map[string]string `json:"Action,optional" copier:"Action"` + Start_action string `json:"start_action" copier:"start_action"` } type StartServerResp struct { @@ -2425,13 +2426,10 @@ type StartServerResp struct { Code int32 `json:"code,omitempty"` } -type OsStart struct { - Os_start string `json:"os_start" copier:"os_start"` -} - type StopServerReq struct { - ServerId string `json:"server_id" copier:"ServerId"` - OsStart OsStart `json:"os_start" copier:"OsStart"` + ServerId string `json:"server_id" copier:"ServerId"` + Action []map[string]string `json:"Action,optional" copier:"Action"` + Stop_action string `json:"stop_action" copier:"stop_action"` } type StopServerResp struct { @@ -2440,13 +2438,9 @@ type StopServerResp struct { Code int32 `json:"code,omitempty"` } -type OsStop struct { - OsStop string `json:"os_stop" copier:"OsStop"` -} - type RebootServerReq struct { - ServerId string `json:"server_id" copier:"ServerId"` - OsStart OsStart `json:"os_start" copier:"OsStart"` + ServerId string `json:"server_id" copier:"ServerId"` + Reboot Reboot `json:"reboot" copier:"Reboot"` } type RebootServerResp struct { @@ -2460,8 +2454,9 @@ type Reboot struct { } type PauseServerReq struct { - ServerId string `json:"server_id" copier:"ServerId"` - OsStart OsStart `json:"os_start" copier:"OsStart"` + ServerId string `json:"server_id" copier:"ServerId"` + Action []map[string]string `json:"Action,optional" copier:"Action"` + Pause_action string `json:"pause_action" copier:"pause_action"` } type PauseServerResp struct { @@ -2470,10 +2465,6 @@ type PauseServerResp struct { Code int32 `json:"code,omitempty"` } -type OsPause struct { - Pause string `json:"pause" copier:"Pause"` -} - type DeleteServerReq struct { ServerId string `form:"server_id" copier:"ServerId"` } diff --git a/go.mod b/go.mod index b76b7131..cc157fb6 100644 --- a/go.mod +++ b/go.mod @@ -15,6 +15,7 @@ require ( github.com/jinzhu/copier v0.3.5 github.com/nacos-group/nacos-sdk-go/v2 v2.2.3 github.com/pkg/errors v0.9.1 + github.com/prometheus/client_golang v1.16.0 github.com/redis/go-redis/v9 v9.2.1 github.com/robfig/cron/v3 v3.0.1 github.com/shopspring/decimal v1.3.1 @@ -25,7 +26,7 @@ require ( gitlink.org.cn/jcce-pcm/pcm-participant-kubernetes v0.0.0-20230830120334-bf6d99c715ef gitlink.org.cn/jcce-pcm/pcm-participant-modelarts v0.0.0-20230719015658-08a29549d86a gitlink.org.cn/jcce-pcm/pcm-participant-octopus v0.0.0-20231011071802-c6a7637b74e4 - gitlink.org.cn/jcce-pcm/pcm-participant-openstack v0.0.0-20231023073226-621f06a5f10c + gitlink.org.cn/jcce-pcm/pcm-participant-openstack v0.0.0-20231024105731-cbdceff549c9 gitlink.org.cn/jcce-pcm/pcm-participant-slurm v0.0.0-20230714030125-a52fa198ddf4 gitlink.org.cn/jcce-pcm/utils v0.0.2 go.opentelemetry.io/otel/trace v1.14.0 @@ -95,7 +96,6 @@ require ( github.com/openzipkin/zipkin-go v0.4.1 // indirect github.com/pelletier/go-toml/v2 v2.0.9 // indirect github.com/pierrec/lz4/v4 v4.1.17 // indirect - github.com/prometheus/client_golang v1.16.0 // indirect github.com/prometheus/client_model v0.4.0 // indirect github.com/prometheus/common v0.44.0 // indirect github.com/prometheus/procfs v0.10.1 // indirect diff --git a/go.sum b/go.sum index 332d9724..128c9beb 100644 --- a/go.sum +++ b/go.sum @@ -761,6 +761,7 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfC github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= @@ -840,6 +841,7 @@ github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8m github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nacos-group/nacos-sdk-go/v2 v2.2.1/go.mod h1:ys/1adWeKXXzbNWfRNbaFlX/t6HVLWdpsNDvmoWTw0g= @@ -1041,8 +1043,8 @@ gitlink.org.cn/jcce-pcm/pcm-participant-modelarts v0.0.0-20230719015658-08a29549 gitlink.org.cn/jcce-pcm/pcm-participant-modelarts v0.0.0-20230719015658-08a29549d86a/go.mod h1:BhOgwM1LC+BD46DjTaQyYQVZs1CikwI5Pl/6qzKUexc= gitlink.org.cn/jcce-pcm/pcm-participant-octopus v0.0.0-20231011071802-c6a7637b74e4 h1:iv78VZ5+j6/VNkEyD/GSmTJ96rpxzpKDUNknAoXsAmg= gitlink.org.cn/jcce-pcm/pcm-participant-octopus v0.0.0-20231011071802-c6a7637b74e4/go.mod h1:uyvpVqG1jHDXX+ubXI0RBwnWXzVykD/mliqGQIDvRoo= -gitlink.org.cn/jcce-pcm/pcm-participant-openstack v0.0.0-20231023073226-621f06a5f10c h1:1w6KnIUnXYVzr2r/I67HFHH/3SbyjuTznOfwUt7dbHc= -gitlink.org.cn/jcce-pcm/pcm-participant-openstack v0.0.0-20231023073226-621f06a5f10c/go.mod h1:m75SVNfNa1TUBlQtBfR0CeETQ0ez2RIUqlSCn1Mb/js= +gitlink.org.cn/jcce-pcm/pcm-participant-openstack v0.0.0-20231024105731-cbdceff549c9 h1:r352e/Vrnity+BgrWyWCgn8uT2xPg6O86g+H4aIOdX8= +gitlink.org.cn/jcce-pcm/pcm-participant-openstack v0.0.0-20231024105731-cbdceff549c9/go.mod h1:m75SVNfNa1TUBlQtBfR0CeETQ0ez2RIUqlSCn1Mb/js= gitlink.org.cn/jcce-pcm/pcm-participant-slurm v0.0.0-20230714030125-a52fa198ddf4 h1:r2hBP5G/bbkPpDTPk3ENnQxD82vkoYMSeNHYhNAVRX4= gitlink.org.cn/jcce-pcm/pcm-participant-slurm v0.0.0-20230714030125-a52fa198ddf4/go.mod h1:zRdVJiv4r4jgBli2xpYGmV0n6Gmz8fkZ5pJaNK2MbTU= gitlink.org.cn/jcce-pcm/utils v0.0.2 h1:Stif8W9C9TOCS2hw4g+OlOywDrsVYNrkiyKfBrWkT0w=