You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

routes.go 11 kB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  1. // Code generated by goctl. DO NOT EDIT.
  2. package handler
  3. import (
  4. "net/http"
  5. ai "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/ai"
  6. cloud "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/cloud"
  7. core "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/core"
  8. hpc "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/hpc"
  9. image "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/image"
  10. storage "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/storage"
  11. vm "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/vm"
  12. "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
  13. "github.com/zeromicro/go-zero/rest"
  14. )
  15. func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
  16. server.AddRoutes(
  17. []rest.Route{
  18. {
  19. Method: http.MethodPost,
  20. Path: "/core/scheduleTaskByYaml",
  21. Handler: core.ScheduleTaskByYamlHandler(serverCtx),
  22. },
  23. {
  24. Method: http.MethodPost,
  25. Path: "/core/scheduleTask",
  26. Handler: core.ScheduleTaskHandler(serverCtx),
  27. },
  28. {
  29. Method: http.MethodGet,
  30. Path: "/core/taskList",
  31. Handler: core.TaskListHandler(serverCtx),
  32. },
  33. {
  34. Method: http.MethodGet,
  35. Path: "/core/jobTotal",
  36. Handler: core.JobTotalHandler(serverCtx),
  37. },
  38. {
  39. Method: http.MethodGet,
  40. Path: "/core/listCenter",
  41. Handler: core.ListCenterHandler(serverCtx),
  42. },
  43. {
  44. Method: http.MethodGet,
  45. Path: "/core/listCluster/:centerId",
  46. Handler: core.ListClusterHandler(serverCtx),
  47. },
  48. {
  49. Method: http.MethodPost,
  50. Path: "/core/submitJob",
  51. Handler: core.SubmitJobHandler(serverCtx),
  52. },
  53. {
  54. Method: http.MethodGet,
  55. Path: "/core/getRegion",
  56. Handler: core.GetRegionHandler(serverCtx),
  57. },
  58. {
  59. Method: http.MethodGet,
  60. Path: "/core/listRegion",
  61. Handler: core.ListRegionHandler(serverCtx),
  62. },
  63. {
  64. Method: http.MethodGet,
  65. Path: "/core/getComputingPower",
  66. Handler: core.GetComputingPowerHandler(serverCtx),
  67. },
  68. {
  69. Method: http.MethodGet,
  70. Path: "/core/getGeneralInfo",
  71. Handler: core.GetGeneralInfoHandler(serverCtx),
  72. },
  73. {
  74. Method: http.MethodGet,
  75. Path: "/core/listDomainResource",
  76. Handler: core.ListDomainResourceHandler(serverCtx),
  77. },
  78. {
  79. Method: http.MethodGet,
  80. Path: "/core/getResourcePanelConfigHandler",
  81. Handler: core.GetResourcePanelConfigHandler(serverCtx),
  82. },
  83. {
  84. Method: http.MethodPut,
  85. Path: "/core/resourcePanelConfigHandler",
  86. Handler: core.PutResourcePanelConfigHandler(serverCtx),
  87. },
  88. {
  89. Method: http.MethodGet,
  90. Path: "/core/assets",
  91. Handler: core.NodeAssetsHandler(serverCtx),
  92. },
  93. },
  94. rest.WithPrefix("/pcm/v1"),
  95. )
  96. server.AddRoutes(
  97. []rest.Route{
  98. {
  99. Method: http.MethodGet,
  100. Path: "/hpc/listJob",
  101. Handler: hpc.ListJobHandler(serverCtx),
  102. },
  103. {
  104. Method: http.MethodGet,
  105. Path: "/hpc/listHistoryJob",
  106. Handler: hpc.ListHistoryJobHandler(serverCtx),
  107. },
  108. {
  109. Method: http.MethodGet,
  110. Path: "/queue/assets",
  111. Handler: hpc.QueueAssetsHandler(serverCtx),
  112. },
  113. },
  114. rest.WithPrefix("/pcm/v1"),
  115. )
  116. server.AddRoutes(
  117. []rest.Route{
  118. {
  119. Method: http.MethodGet,
  120. Path: "/cloud/ApplyYaml",
  121. Handler: cloud.ApplyYamlHandler(serverCtx),
  122. },
  123. {
  124. Method: http.MethodGet,
  125. Path: "/cloud/DeleteYaml",
  126. Handler: cloud.DeleteYamlHandler(serverCtx),
  127. },
  128. },
  129. rest.WithPrefix("/pcm/v1"),
  130. )
  131. server.AddRoutes(
  132. []rest.Route{
  133. {
  134. Method: http.MethodGet,
  135. Path: "/ai/listDataSet/:projectId",
  136. Handler: ai.ListDataSetHandler(serverCtx),
  137. },
  138. {
  139. Method: http.MethodPost,
  140. Path: "/ai/createDataSet/:projectId",
  141. Handler: ai.CreateDataSetHandler(serverCtx),
  142. },
  143. {
  144. Method: http.MethodDelete,
  145. Path: "/ai/deleteDataSet/:projectId/:datasetId",
  146. Handler: ai.DeleteDataSetHandler(serverCtx),
  147. },
  148. {
  149. Method: http.MethodPost,
  150. Path: "/ai/CreateTask/:projectId/:datasetId",
  151. Handler: ai.CreateTaskHandler(serverCtx),
  152. },
  153. {
  154. Method: http.MethodGet,
  155. Path: "/ai/ListImport/:projectId/:datasetId",
  156. Handler: ai.ListImportHandler(serverCtx),
  157. },
  158. {
  159. Method: http.MethodGet,
  160. Path: "/ai/GetListTrainingJobs/:projectId",
  161. Handler: ai.GetListTrainingJobsHandler(serverCtx),
  162. },
  163. {
  164. Method: http.MethodDelete,
  165. Path: "/ai/DeleteTrainingJob/:projectId/:trainingJobId",
  166. Handler: ai.DeleteTrainingJobHandler(serverCtx),
  167. },
  168. {
  169. Method: http.MethodPost,
  170. Path: "/ai/CreateAlgorithm/:projectId",
  171. Handler: ai.CreateAlgorithmHandler(serverCtx),
  172. },
  173. {
  174. Method: http.MethodGet,
  175. Path: "/ai/ListAlgorithms/:projectId",
  176. Handler: ai.ListAlgorithmsHandler(serverCtx),
  177. },
  178. {
  179. Method: http.MethodDelete,
  180. Path: "/ai/DeleteAlgorithm/:projectId/:algorithmId",
  181. Handler: ai.DeleteAlgorithmHandler(serverCtx),
  182. },
  183. {
  184. Method: http.MethodPost,
  185. Path: "/ai/CreateTrainingJob/:projectId",
  186. Handler: ai.CreateTrainingJobHandler(serverCtx),
  187. },
  188. {
  189. Method: http.MethodGet,
  190. Path: "/ai/ShowAlgorithmByUuid/:projectId/:algorithmId",
  191. Handler: ai.ShowAlgorithmByUuidHandler(serverCtx),
  192. },
  193. {
  194. Method: http.MethodPost,
  195. Path: "/ai/CreateExportTask/:projectId/:datasetId",
  196. Handler: ai.CreateExportTaskHandler(serverCtx),
  197. },
  198. {
  199. Method: http.MethodGet,
  200. Path: "/ai/GetExportTasksOfDataset/:projectId/:datasetId",
  201. Handler: ai.GetExportTasksOfDatasetHandler(serverCtx),
  202. },
  203. {
  204. Method: http.MethodGet,
  205. Path: "/ai/GetExportTaskStatusOfDataset/:projectId/:resourceId/:taskId",
  206. Handler: ai.GetExportTaskStatusOfDatasetHandler(serverCtx),
  207. },
  208. {
  209. Method: http.MethodPost,
  210. Path: "/ai/CreateProcessorTask",
  211. Handler: ai.CreateProcessorTaskHandler(serverCtx),
  212. },
  213. {
  214. Method: http.MethodPost,
  215. Path: "/ai/CreateService/:projectId",
  216. Handler: ai.CreateServiceHandler(serverCtx),
  217. },
  218. {
  219. Method: http.MethodGet,
  220. Path: "/ai/ListServices/:projectId",
  221. Handler: ai.ListServicesHandler(serverCtx),
  222. },
  223. {
  224. Method: http.MethodGet,
  225. Path: "/ai/ShowService/:projectId/:serviceId",
  226. Handler: ai.ShowServiceHandler(serverCtx),
  227. },
  228. {
  229. Method: http.MethodDelete,
  230. Path: "/ai/DeleteService/:projectId/:serviceId",
  231. Handler: ai.DeleteServiceHandler(serverCtx),
  232. },
  233. {
  234. Method: http.MethodGet,
  235. Path: "/ai/ListClusters",
  236. Handler: ai.ListClustersHandler(serverCtx),
  237. },
  238. {
  239. Method: http.MethodGet,
  240. Path: "/ai/listNotebook",
  241. Handler: ai.ListNotebookHandler(serverCtx),
  242. },
  243. {
  244. Method: http.MethodPost,
  245. Path: "/ai/createNotebook",
  246. Handler: ai.CreateNotebookHandler(serverCtx),
  247. },
  248. {
  249. Method: http.MethodPost,
  250. Path: "/ai/startNotebook",
  251. Handler: ai.StartNotebookHandler(serverCtx),
  252. },
  253. {
  254. Method: http.MethodPost,
  255. Path: "/ai/stopNotebook",
  256. Handler: ai.StopNotebookHandler(serverCtx),
  257. },
  258. {
  259. Method: http.MethodGet,
  260. Path: "/ai/getNotebookStorage",
  261. Handler: ai.GetNotebookStorageHandler(serverCtx),
  262. },
  263. {
  264. Method: http.MethodPost,
  265. Path: "/ai/mountNotebookStorage",
  266. Handler: ai.MountNotebookStorageHandler(serverCtx),
  267. },
  268. {
  269. Method: http.MethodGet,
  270. Path: "/ai/getVisualizationJob",
  271. Handler: ai.GetVisualizationJobHandler(serverCtx),
  272. },
  273. {
  274. Method: http.MethodPost,
  275. Path: "/ai/CreateVisualizationJob",
  276. Handler: ai.CreateVisualizationJobHandler(serverCtx),
  277. },
  278. },
  279. rest.WithPrefix("/pcm/v1"),
  280. )
  281. server.AddRoutes(
  282. []rest.Route{
  283. {
  284. Method: http.MethodGet,
  285. Path: "/storage/screenStorage",
  286. Handler: storage.ScreenStorageHandler(serverCtx),
  287. },
  288. {
  289. Method: http.MethodGet,
  290. Path: "/storage/dailyPowerScreen",
  291. Handler: storage.DailyPowerScreenHandler(serverCtx),
  292. },
  293. {
  294. Method: http.MethodGet,
  295. Path: "/storage/perCenterComputerPowers",
  296. Handler: storage.PerCenterComputerPowersHandler(serverCtx),
  297. },
  298. },
  299. rest.WithPrefix("/pcm/v1"),
  300. )
  301. server.AddRoutes(
  302. []rest.Route{
  303. {
  304. Method: http.MethodPost,
  305. Path: "/upload",
  306. Handler: image.UploadHandler(serverCtx),
  307. },
  308. {
  309. Method: http.MethodPost,
  310. Path: "/chunk",
  311. Handler: image.ChunkHandler(serverCtx),
  312. },
  313. {
  314. Method: http.MethodGet,
  315. Path: "/image/list",
  316. Handler: image.ImageListHandler(serverCtx),
  317. },
  318. {
  319. Method: http.MethodGet,
  320. Path: "/dataSet/check/:fileMd5",
  321. Handler: image.DataSetCheckHandler(serverCtx),
  322. },
  323. {
  324. Method: http.MethodPost,
  325. Path: "/dataSet/upload",
  326. Handler: image.UploadDataSetHandler(serverCtx),
  327. },
  328. },
  329. rest.WithPrefix("/pcm/v1"),
  330. )
  331. server.AddRoutes(
  332. []rest.Route{
  333. {
  334. Method: http.MethodGet,
  335. Path: "/vm/listServer",
  336. Handler: vm.ListServerHandler(serverCtx),
  337. },
  338. {
  339. Method: http.MethodGet,
  340. Path: "/vm/listServersDetailed",
  341. Handler: vm.ListServersDetailedHandler(serverCtx),
  342. },
  343. {
  344. Method: http.MethodDelete,
  345. Path: "/vm/deleteServer",
  346. Handler: vm.DeleteServerHandler(serverCtx),
  347. },
  348. {
  349. Method: http.MethodGet,
  350. Path: "/vm/listImages",
  351. Handler: vm.ListImagesHandler(serverCtx),
  352. },
  353. {
  354. Method: http.MethodDelete,
  355. Path: "/vm/deleteImage",
  356. Handler: vm.DeleteImageHandler(serverCtx),
  357. },
  358. {
  359. Method: http.MethodGet,
  360. Path: "/vm/listNetworks",
  361. Handler: vm.ListNetworksHandler(serverCtx),
  362. },
  363. {
  364. Method: http.MethodDelete,
  365. Path: "/vm/deleteNetwork",
  366. Handler: vm.DeleteNetworkHandler(serverCtx),
  367. },
  368. {
  369. Method: http.MethodPost,
  370. Path: "/vm/createNetwork",
  371. Handler: vm.CreateNetworkHandler(serverCtx),
  372. },
  373. {
  374. Method: http.MethodPost,
  375. Path: "/vm/createSubnet",
  376. Handler: vm.CreateSubnetHandler(serverCtx),
  377. },
  378. {
  379. Method: http.MethodGet,
  380. Path: "/vm/listVolumesDetail",
  381. Handler: vm.ListVolumesDetailHandler(serverCtx),
  382. },
  383. {
  384. Method: http.MethodDelete,
  385. Path: "/vm/deleteVolume",
  386. Handler: vm.DeleteVolumeHandler(serverCtx),
  387. },
  388. {
  389. Method: http.MethodPost,
  390. Path: "/vm/createVolume",
  391. Handler: vm.CreateVolumeHandler(serverCtx),
  392. },
  393. {
  394. Method: http.MethodGet,
  395. Path: "/vm/listFlavorsDetail",
  396. Handler: vm.ListFlavorsDetailHandler(serverCtx),
  397. },
  398. {
  399. Method: http.MethodPost,
  400. Path: "/vm/createServer",
  401. Handler: vm.CreateServerHandler(serverCtx),
  402. },
  403. },
  404. rest.WithPrefix("/pcm/v1"),
  405. )
  406. }

PCM is positioned as Software stack over Cloud, aiming to build the standards and ecology of heterogeneous cloud collaboration for JCC in a non intrusive and autonomous peer-to-peer manner.