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 8.2 kB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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. core "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/core"
  7. hpc "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/hpc"
  8. image "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/image"
  9. storage "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/storage"
  10. "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
  11. "github.com/zeromicro/go-zero/rest"
  12. )
  13. func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
  14. server.AddRoutes(
  15. []rest.Route{
  16. {
  17. Method: http.MethodPost,
  18. Path: "/core/scheduleTaskByYaml",
  19. Handler: core.ScheduleTaskByYamlHandler(serverCtx),
  20. },
  21. {
  22. Method: http.MethodPost,
  23. Path: "/core/scheduleTask",
  24. Handler: core.ScheduleTaskHandler(serverCtx),
  25. },
  26. {
  27. Method: http.MethodGet,
  28. Path: "/core/taskList",
  29. Handler: core.TaskListHandler(serverCtx),
  30. },
  31. {
  32. Method: http.MethodGet,
  33. Path: "/core/jobTotal",
  34. Handler: core.JobTotalHandler(serverCtx),
  35. },
  36. {
  37. Method: http.MethodGet,
  38. Path: "/core/listCenter",
  39. Handler: core.ListCenterHandler(serverCtx),
  40. },
  41. {
  42. Method: http.MethodGet,
  43. Path: "/core/listCluster/:centerId",
  44. Handler: core.ListClusterHandler(serverCtx),
  45. },
  46. {
  47. Method: http.MethodPost,
  48. Path: "/core/submitJob",
  49. Handler: core.SubmitJobHandler(serverCtx),
  50. },
  51. {
  52. Method: http.MethodGet,
  53. Path: "/core/getRegion",
  54. Handler: core.GetRegionHandler(serverCtx),
  55. },
  56. {
  57. Method: http.MethodGet,
  58. Path: "/core/listRegion",
  59. Handler: core.ListRegionHandler(serverCtx),
  60. },
  61. {
  62. Method: http.MethodGet,
  63. Path: "/core/getComputingPower",
  64. Handler: core.GetComputingPowerHandler(serverCtx),
  65. },
  66. {
  67. Method: http.MethodGet,
  68. Path: "/core/getGeneralInfo",
  69. Handler: core.GetGeneralInfoHandler(serverCtx),
  70. },
  71. {
  72. Method: http.MethodGet,
  73. Path: "/core/listDomainResource",
  74. Handler: core.ListDomainResourceHandler(serverCtx),
  75. },
  76. {
  77. Method: http.MethodGet,
  78. Path: "/core/getResourcePanelConfigHandler",
  79. Handler: core.GetResourcePanelConfigHandler(serverCtx),
  80. },
  81. {
  82. Method: http.MethodPut,
  83. Path: "/core/resourcePanelConfigHandler",
  84. Handler: core.PutResourcePanelConfigHandler(serverCtx),
  85. },
  86. },
  87. rest.WithPrefix("/pcm/v1"),
  88. )
  89. server.AddRoutes(
  90. []rest.Route{
  91. {
  92. Method: http.MethodGet,
  93. Path: "/hpc/listJob",
  94. Handler: hpc.ListJobHandler(serverCtx),
  95. },
  96. {
  97. Method: http.MethodGet,
  98. Path: "/hpc/listHistoryJob",
  99. Handler: hpc.ListHistoryJobHandler(serverCtx),
  100. },
  101. },
  102. rest.WithPrefix("/pcm/v1"),
  103. )
  104. server.AddRoutes(
  105. []rest.Route{
  106. {
  107. Method: http.MethodGet,
  108. Path: "/ai/listDataSet/:projectId",
  109. Handler: ai.ListDataSetHandler(serverCtx),
  110. },
  111. {
  112. Method: http.MethodPost,
  113. Path: "/ai/createDataSet/:projectId",
  114. Handler: ai.CreateDataSetHandler(serverCtx),
  115. },
  116. {
  117. Method: http.MethodDelete,
  118. Path: "/ai/deleteDataSet/:projectId/:datasetId",
  119. Handler: ai.DeleteDataSetHandler(serverCtx),
  120. },
  121. {
  122. Method: http.MethodPost,
  123. Path: "/ai/CreateTask/:projectId/:datasetId",
  124. Handler: ai.CreateTaskHandler(serverCtx),
  125. },
  126. {
  127. Method: http.MethodGet,
  128. Path: "/ai/ListImport/:projectId/:datasetId",
  129. Handler: ai.ListImportHandler(serverCtx),
  130. },
  131. {
  132. Method: http.MethodGet,
  133. Path: "/ai/GetListTrainingJobs/:projectId",
  134. Handler: ai.GetListTrainingJobsHandler(serverCtx),
  135. },
  136. {
  137. Method: http.MethodDelete,
  138. Path: "/ai/DeleteTrainingJob/:projectId/:trainingJobId",
  139. Handler: ai.DeleteTrainingJobHandler(serverCtx),
  140. },
  141. {
  142. Method: http.MethodPost,
  143. Path: "/ai/CreateAlgorithm/:projectId",
  144. Handler: ai.CreateAlgorithmHandler(serverCtx),
  145. },
  146. {
  147. Method: http.MethodGet,
  148. Path: "/ai/ListAlgorithms/:projectId",
  149. Handler: ai.ListAlgorithmsHandler(serverCtx),
  150. },
  151. {
  152. Method: http.MethodDelete,
  153. Path: "/ai/DeleteAlgorithm/:projectId/:algorithmId",
  154. Handler: ai.DeleteAlgorithmHandler(serverCtx),
  155. },
  156. {
  157. Method: http.MethodPost,
  158. Path: "/ai/CreateTrainingJob/:projectId",
  159. Handler: ai.CreateTrainingJobHandler(serverCtx),
  160. },
  161. {
  162. Method: http.MethodGet,
  163. Path: "/ai/ShowAlgorithmByUuid/:projectId/:algorithmId",
  164. Handler: ai.ShowAlgorithmByUuidHandler(serverCtx),
  165. },
  166. {
  167. Method: http.MethodPost,
  168. Path: "/ai/CreateExportTask/:projectId/:datasetId",
  169. Handler: ai.CreateExportTaskHandler(serverCtx),
  170. },
  171. {
  172. Method: http.MethodGet,
  173. Path: "/ai/GetExportTasksOfDataset/:projectId/:datasetId",
  174. Handler: ai.GetExportTasksOfDatasetHandler(serverCtx),
  175. },
  176. {
  177. Method: http.MethodGet,
  178. Path: "/ai/GetExportTaskStatusOfDataset/:projectId/:resourceId/:taskId",
  179. Handler: ai.GetExportTaskStatusOfDatasetHandler(serverCtx),
  180. },
  181. {
  182. Method: http.MethodPost,
  183. Path: "/ai/CreateProcessorTask",
  184. Handler: ai.CreateProcessorTaskHandler(serverCtx),
  185. },
  186. {
  187. Method: http.MethodPost,
  188. Path: "/ai/CreateService/:projectId",
  189. Handler: ai.CreateServiceHandler(serverCtx),
  190. },
  191. {
  192. Method: http.MethodGet,
  193. Path: "/ai/ListServices/:projectId",
  194. Handler: ai.ListServicesHandler(serverCtx),
  195. },
  196. {
  197. Method: http.MethodGet,
  198. Path: "/ai/ShowService/:projectId/:serviceId",
  199. Handler: ai.ShowServiceHandler(serverCtx),
  200. },
  201. {
  202. Method: http.MethodDelete,
  203. Path: "/ai/DeleteService/:projectId/:serviceId",
  204. Handler: ai.DeleteServiceHandler(serverCtx),
  205. },
  206. {
  207. Method: http.MethodGet,
  208. Path: "/ai/ListClusters",
  209. Handler: ai.ListClustersHandler(serverCtx),
  210. },
  211. {
  212. Method: http.MethodGet,
  213. Path: "/ai/listNotebook",
  214. Handler: ai.ListNotebookHandler(serverCtx),
  215. },
  216. {
  217. Method: http.MethodPost,
  218. Path: "/ai/createNotebook",
  219. Handler: ai.CreateNotebookHandler(serverCtx),
  220. },
  221. {
  222. Method: http.MethodPost,
  223. Path: "/ai/startNotebook",
  224. Handler: ai.StartNotebookHandler(serverCtx),
  225. },
  226. {
  227. Method: http.MethodPost,
  228. Path: "/ai/stopNotebook",
  229. Handler: ai.StopNotebookHandler(serverCtx),
  230. },
  231. {
  232. Method: http.MethodGet,
  233. Path: "/ai/getNotebookStorage",
  234. Handler: ai.GetNotebookStorageHandler(serverCtx),
  235. },
  236. {
  237. Method: http.MethodPost,
  238. Path: "/ai/mountNotebookStorage",
  239. Handler: ai.MountNotebookStorageHandler(serverCtx),
  240. },
  241. {
  242. Method: http.MethodGet,
  243. Path: "/ai/getVisualizationJob",
  244. Handler: ai.GetVisualizationJobHandler(serverCtx),
  245. },
  246. {
  247. Method: http.MethodPost,
  248. Path: "/ai/CreateVisualizationJob",
  249. Handler: ai.CreateVisualizationJobHandler(serverCtx),
  250. },
  251. },
  252. rest.WithPrefix("/pcm/v1"),
  253. )
  254. server.AddRoutes(
  255. []rest.Route{
  256. {
  257. Method: http.MethodGet,
  258. Path: "/storage/screenStorage",
  259. Handler: storage.ScreenStorageHandler(serverCtx),
  260. },
  261. {
  262. Method: http.MethodGet,
  263. Path: "/storage/dailyPowerScreen",
  264. Handler: storage.DailyPowerScreenHandler(serverCtx),
  265. },
  266. {
  267. Method: http.MethodGet,
  268. Path: "/storage/perCenterComputerPowers",
  269. Handler: storage.PerCenterComputerPowersHandler(serverCtx),
  270. },
  271. },
  272. rest.WithPrefix("/pcm/v1"),
  273. )
  274. server.AddRoutes(
  275. []rest.Route{
  276. {
  277. Method: http.MethodPost,
  278. Path: "/upload",
  279. Handler: image.UploadHandler(serverCtx),
  280. },
  281. {
  282. Method: http.MethodPost,
  283. Path: "/chunk",
  284. Handler: image.ChunkHandler(serverCtx),
  285. },
  286. {
  287. Method: http.MethodGet,
  288. Path: "/image/list",
  289. Handler: image.ImageListHandler(serverCtx),
  290. },
  291. {
  292. Method: http.MethodGet,
  293. Path: "/dataSet/check/:fileMd5",
  294. Handler: image.DataSetCheckHandler(serverCtx),
  295. },
  296. {
  297. Method: http.MethodPost,
  298. Path: "/dataSet/upload",
  299. Handler: image.UploadDataSetHandler(serverCtx),
  300. },
  301. },
  302. rest.WithPrefix("/pcm/v1"),
  303. )
  304. }

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.