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

2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  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. storelink "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/storelink"
  12. vm "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/vm"
  13. "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
  14. "github.com/zeromicro/go-zero/rest"
  15. )
  16. func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
  17. server.AddRoutes(
  18. []rest.Route{
  19. {
  20. Method: http.MethodGet,
  21. Path: "/core/participantList",
  22. Handler: core.ParticipantListHandler(serverCtx),
  23. },
  24. {
  25. Method: http.MethodPost,
  26. Path: "/core/scheduleTaskByYaml",
  27. Handler: core.ScheduleTaskByYamlHandler(serverCtx),
  28. },
  29. {
  30. Method: http.MethodDelete,
  31. Path: "/core/deleteTask/:id",
  32. Handler: core.DeleteTaskHandler(serverCtx),
  33. },
  34. {
  35. Method: http.MethodGet,
  36. Path: "/core/taskList",
  37. Handler: core.TaskListHandler(serverCtx),
  38. },
  39. {
  40. Method: http.MethodGet,
  41. Path: "/core/taskDetail/:taskId",
  42. Handler: core.TaskDetailHandler(serverCtx),
  43. },
  44. {
  45. Method: http.MethodGet,
  46. Path: "/core/jobTotal",
  47. Handler: core.JobTotalHandler(serverCtx),
  48. },
  49. {
  50. Method: http.MethodGet,
  51. Path: "/core/listCenter",
  52. Handler: core.ListCenterHandler(serverCtx),
  53. },
  54. {
  55. Method: http.MethodGet,
  56. Path: "/core/listCluster/:centerId",
  57. Handler: core.ListClusterHandler(serverCtx),
  58. },
  59. {
  60. Method: http.MethodPost,
  61. Path: "/core/submitJob",
  62. Handler: core.SubmitJobHandler(serverCtx),
  63. },
  64. {
  65. Method: http.MethodGet,
  66. Path: "/core/getRegion",
  67. Handler: core.GetRegionHandler(serverCtx),
  68. },
  69. {
  70. Method: http.MethodGet,
  71. Path: "/core/listRegion",
  72. Handler: core.ListRegionHandler(serverCtx),
  73. },
  74. {
  75. Method: http.MethodGet,
  76. Path: "/core/getComputingPower",
  77. Handler: core.GetComputingPowerHandler(serverCtx),
  78. },
  79. {
  80. Method: http.MethodGet,
  81. Path: "/core/getGeneralInfo",
  82. Handler: core.GetGeneralInfoHandler(serverCtx),
  83. },
  84. {
  85. Method: http.MethodGet,
  86. Path: "/core/listDomainResource",
  87. Handler: core.ListDomainResourceHandler(serverCtx),
  88. },
  89. {
  90. Method: http.MethodGet,
  91. Path: "/core/getResourcePanelConfigHandler",
  92. Handler: core.GetResourcePanelConfigHandler(serverCtx),
  93. },
  94. {
  95. Method: http.MethodPut,
  96. Path: "/core/resourcePanelConfigHandler",
  97. Handler: core.PutResourcePanelConfigHandler(serverCtx),
  98. },
  99. {
  100. Method: http.MethodGet,
  101. Path: "/core/getComputilityStatistics",
  102. Handler: core.GetComputilityStatisticsHandler(serverCtx),
  103. },
  104. {
  105. Method: http.MethodGet,
  106. Path: "/core/assets",
  107. Handler: core.NodeAssetsHandler(serverCtx),
  108. },
  109. {
  110. Method: http.MethodPost,
  111. Path: "/core/saveHashcat",
  112. Handler: core.SaveHashcatHandler(serverCtx),
  113. },
  114. {
  115. Method: http.MethodGet,
  116. Path: "/core/getHashcat/:crackTaskId",
  117. Handler: core.GetHashcatHandler(serverCtx),
  118. },
  119. },
  120. rest.WithPrefix("/pcm/v1"),
  121. )
  122. server.AddRoutes(
  123. []rest.Route{
  124. {
  125. Method: http.MethodGet,
  126. Path: "/hpc/listJob",
  127. Handler: hpc.ListJobHandler(serverCtx),
  128. },
  129. {
  130. Method: http.MethodGet,
  131. Path: "/hpc/listHistoryJob",
  132. Handler: hpc.ListHistoryJobHandler(serverCtx),
  133. },
  134. {
  135. Method: http.MethodGet,
  136. Path: "/queue/assets",
  137. Handler: hpc.QueueAssetsHandler(serverCtx),
  138. },
  139. },
  140. rest.WithPrefix("/pcm/v1"),
  141. )
  142. server.AddRoutes(
  143. []rest.Route{
  144. {
  145. Method: http.MethodGet,
  146. Path: "/task/list",
  147. Handler: cloud.CloudListHandler(serverCtx),
  148. },
  149. {
  150. Method: http.MethodGet,
  151. Path: "/cloud/DeleteYaml",
  152. Handler: cloud.DeleteYamlHandler(serverCtx),
  153. },
  154. },
  155. rest.WithPrefix("/pcm/v1"),
  156. )
  157. server.AddRoutes(
  158. []rest.Route{
  159. {
  160. Method: http.MethodGet,
  161. Path: "/ai/listDataSet/:projectId",
  162. Handler: ai.ListDataSetHandler(serverCtx),
  163. },
  164. {
  165. Method: http.MethodPost,
  166. Path: "/ai/createDataSet/:projectId",
  167. Handler: ai.CreateDataSetHandler(serverCtx),
  168. },
  169. {
  170. Method: http.MethodDelete,
  171. Path: "/ai/deleteDataSet/:projectId/:datasetId",
  172. Handler: ai.DeleteDataSetHandler(serverCtx),
  173. },
  174. {
  175. Method: http.MethodPost,
  176. Path: "/ai/CreateTask/:projectId/:datasetId",
  177. Handler: ai.CreateTaskHandler(serverCtx),
  178. },
  179. {
  180. Method: http.MethodGet,
  181. Path: "/ai/ListImport/:projectId/:datasetId",
  182. Handler: ai.ListImportHandler(serverCtx),
  183. },
  184. {
  185. Method: http.MethodGet,
  186. Path: "/ai/GetListTrainingJobs/:projectId",
  187. Handler: ai.GetListTrainingJobsHandler(serverCtx),
  188. },
  189. {
  190. Method: http.MethodDelete,
  191. Path: "/ai/DeleteTrainingJob/:projectId/:trainingJobId",
  192. Handler: ai.DeleteTrainingJobHandler(serverCtx),
  193. },
  194. {
  195. Method: http.MethodPost,
  196. Path: "/ai/CreateAlgorithm/:projectId",
  197. Handler: ai.CreateAlgorithmHandler(serverCtx),
  198. },
  199. {
  200. Method: http.MethodGet,
  201. Path: "/ai/ListAlgorithms/:projectId",
  202. Handler: ai.ListAlgorithmsHandler(serverCtx),
  203. },
  204. {
  205. Method: http.MethodDelete,
  206. Path: "/ai/DeleteAlgorithm/:projectId/:algorithmId",
  207. Handler: ai.DeleteAlgorithmHandler(serverCtx),
  208. },
  209. {
  210. Method: http.MethodPost,
  211. Path: "/ai/CreateTrainingJob/:projectId",
  212. Handler: ai.CreateTrainingJobHandler(serverCtx),
  213. },
  214. {
  215. Method: http.MethodGet,
  216. Path: "/ai/ShowAlgorithmByUuid/:projectId/:algorithmId",
  217. Handler: ai.ShowAlgorithmByUuidHandler(serverCtx),
  218. },
  219. {
  220. Method: http.MethodPost,
  221. Path: "/ai/CreateExportTask/:projectId/:datasetId",
  222. Handler: ai.CreateExportTaskHandler(serverCtx),
  223. },
  224. {
  225. Method: http.MethodGet,
  226. Path: "/ai/GetExportTasksOfDataset/:projectId/:datasetId",
  227. Handler: ai.GetExportTasksOfDatasetHandler(serverCtx),
  228. },
  229. {
  230. Method: http.MethodGet,
  231. Path: "/ai/GetExportTaskStatusOfDataset/:projectId/:resourceId/:taskId",
  232. Handler: ai.GetExportTaskStatusOfDatasetHandler(serverCtx),
  233. },
  234. {
  235. Method: http.MethodPost,
  236. Path: "/ai/CreateProcessorTask",
  237. Handler: ai.CreateProcessorTaskHandler(serverCtx),
  238. },
  239. {
  240. Method: http.MethodPost,
  241. Path: "/ai/CreateService/:projectId",
  242. Handler: ai.CreateServiceHandler(serverCtx),
  243. },
  244. {
  245. Method: http.MethodGet,
  246. Path: "/ai/ListServices/:projectId",
  247. Handler: ai.ListServicesHandler(serverCtx),
  248. },
  249. {
  250. Method: http.MethodGet,
  251. Path: "/ai/ShowService/:projectId/:serviceId",
  252. Handler: ai.ShowServiceHandler(serverCtx),
  253. },
  254. {
  255. Method: http.MethodDelete,
  256. Path: "/ai/DeleteService/:projectId/:serviceId",
  257. Handler: ai.DeleteServiceHandler(serverCtx),
  258. },
  259. {
  260. Method: http.MethodGet,
  261. Path: "/ai/ListClusters",
  262. Handler: ai.ListClustersHandler(serverCtx),
  263. },
  264. {
  265. Method: http.MethodGet,
  266. Path: "/ai/listNotebook",
  267. Handler: ai.ListNotebookHandler(serverCtx),
  268. },
  269. {
  270. Method: http.MethodPost,
  271. Path: "/ai/createNotebook",
  272. Handler: ai.CreateNotebookHandler(serverCtx),
  273. },
  274. {
  275. Method: http.MethodPost,
  276. Path: "/ai/startNotebook",
  277. Handler: ai.StartNotebookHandler(serverCtx),
  278. },
  279. {
  280. Method: http.MethodPost,
  281. Path: "/ai/stopNotebook",
  282. Handler: ai.StopNotebookHandler(serverCtx),
  283. },
  284. {
  285. Method: http.MethodGet,
  286. Path: "/ai/getNotebookStorage",
  287. Handler: ai.GetNotebookStorageHandler(serverCtx),
  288. },
  289. {
  290. Method: http.MethodPost,
  291. Path: "/ai/mountNotebookStorage",
  292. Handler: ai.MountNotebookStorageHandler(serverCtx),
  293. },
  294. {
  295. Method: http.MethodGet,
  296. Path: "/ai/getVisualizationJob",
  297. Handler: ai.GetVisualizationJobHandler(serverCtx),
  298. },
  299. {
  300. Method: http.MethodPost,
  301. Path: "/ai/CreateVisualizationJob",
  302. Handler: ai.CreateVisualizationJobHandler(serverCtx),
  303. },
  304. },
  305. rest.WithPrefix("/pcm/v1"),
  306. )
  307. server.AddRoutes(
  308. []rest.Route{
  309. {
  310. Method: http.MethodGet,
  311. Path: "/storage/screenStorage",
  312. Handler: storage.ScreenStorageHandler(serverCtx),
  313. },
  314. {
  315. Method: http.MethodGet,
  316. Path: "/storage/dailyPowerScreen",
  317. Handler: storage.DailyPowerScreenHandler(serverCtx),
  318. },
  319. {
  320. Method: http.MethodGet,
  321. Path: "/storage/perCenterComputerPowers",
  322. Handler: storage.PerCenterComputerPowersHandler(serverCtx),
  323. },
  324. },
  325. rest.WithPrefix("/pcm/v1"),
  326. )
  327. server.AddRoutes(
  328. []rest.Route{
  329. {
  330. Method: http.MethodPost,
  331. Path: "/upload",
  332. Handler: image.UploadHandler(serverCtx),
  333. },
  334. {
  335. Method: http.MethodPost,
  336. Path: "/chunk",
  337. Handler: image.ChunkHandler(serverCtx),
  338. },
  339. {
  340. Method: http.MethodGet,
  341. Path: "/image/list",
  342. Handler: image.ImageListHandler(serverCtx),
  343. },
  344. {
  345. Method: http.MethodGet,
  346. Path: "/dataSet/check/:fileMd5",
  347. Handler: image.DataSetCheckHandler(serverCtx),
  348. },
  349. {
  350. Method: http.MethodPost,
  351. Path: "/dataSet/upload",
  352. Handler: image.UploadDataSetHandler(serverCtx),
  353. },
  354. },
  355. rest.WithPrefix("/pcm/v1"),
  356. )
  357. server.AddRoutes(
  358. []rest.Route{
  359. {
  360. Method: http.MethodGet,
  361. Path: "/vm/getComputeLimits",
  362. Handler: vm.GetComputeLimitsHandler(serverCtx),
  363. },
  364. {
  365. Method: http.MethodGet,
  366. Path: "/vm/getVolumeLimits",
  367. Handler: vm.GetVolumeLimitsHandler(serverCtx),
  368. },
  369. {
  370. Method: http.MethodGet,
  371. Path: "/vm/listServer",
  372. Handler: vm.ListServerHandler(serverCtx),
  373. },
  374. {
  375. Method: http.MethodGet,
  376. Path: "/vm/listServersDetailed",
  377. Handler: vm.ListServersDetailedHandler(serverCtx),
  378. },
  379. {
  380. Method: http.MethodDelete,
  381. Path: "/vm/deleteServer",
  382. Handler: vm.DeleteServerHandler(serverCtx),
  383. },
  384. {
  385. Method: http.MethodPost,
  386. Path: "/vm/createServer",
  387. Handler: vm.CreateServerHandler(serverCtx),
  388. },
  389. {
  390. Method: http.MethodGet,
  391. Path: "/vm/getServersDetailedById",
  392. Handler: vm.GetServersDetailedByIdHandler(serverCtx),
  393. },
  394. {
  395. Method: http.MethodPut,
  396. Path: "/vm/updateServer",
  397. Handler: vm.UpdateServerHandler(serverCtx),
  398. },
  399. {
  400. Method: http.MethodPost,
  401. Path: "/vm/startServer",
  402. Handler: vm.StartServerHandler(serverCtx),
  403. },
  404. {
  405. Method: http.MethodPost,
  406. Path: "/vm/stopServer",
  407. Handler: vm.StopServerHandler(serverCtx),
  408. },
  409. {
  410. Method: http.MethodPost,
  411. Path: "/vm/rebootServer",
  412. Handler: vm.RebootServerHandler(serverCtx),
  413. },
  414. {
  415. Method: http.MethodPost,
  416. Path: "/vm/pauseServer",
  417. Handler: vm.PauseServerHandler(serverCtx),
  418. },
  419. {
  420. Method: http.MethodGet,
  421. Path: "/vm/listImages",
  422. Handler: vm.ListImagesHandler(serverCtx),
  423. },
  424. {
  425. Method: http.MethodDelete,
  426. Path: "/vm/deleteImage",
  427. Handler: vm.DeleteImageHandler(serverCtx),
  428. },
  429. {
  430. Method: http.MethodPost,
  431. Path: "/vm/createImage",
  432. Handler: vm.CreateImageHandler(serverCtx),
  433. },
  434. {
  435. Method: http.MethodPut,
  436. Path: "/vm/uploadImage",
  437. Handler: vm.UploadImageHandler(serverCtx),
  438. },
  439. {
  440. Method: http.MethodGet,
  441. Path: "/vm/listNetworks",
  442. Handler: vm.ListNetworksHandler(serverCtx),
  443. },
  444. {
  445. Method: http.MethodDelete,
  446. Path: "/vm/deleteNetwork",
  447. Handler: vm.DeleteNetworkHandler(serverCtx),
  448. },
  449. {
  450. Method: http.MethodPost,
  451. Path: "/vm/createNetwork",
  452. Handler: vm.CreateNetworkHandler(serverCtx),
  453. },
  454. {
  455. Method: http.MethodPost,
  456. Path: "/vm/createSubnet",
  457. Handler: vm.CreateSubnetHandler(serverCtx),
  458. },
  459. {
  460. Method: http.MethodGet,
  461. Path: "/vm/showNetworkDetails",
  462. Handler: vm.ShowNetworkDetailsHandler(serverCtx),
  463. },
  464. {
  465. Method: http.MethodPut,
  466. Path: "/vm/updateNetwork",
  467. Handler: vm.UpdateNetworkHandler(serverCtx),
  468. },
  469. {
  470. Method: http.MethodPost,
  471. Path: "/vm/bulkCreateNetworks",
  472. Handler: vm.BulkCreateNetworksHandler(serverCtx),
  473. },
  474. {
  475. Method: http.MethodGet,
  476. Path: "/vm/listVolumesDetail",
  477. Handler: vm.ListVolumesDetailHandler(serverCtx),
  478. },
  479. {
  480. Method: http.MethodDelete,
  481. Path: "/vm/deleteVolume",
  482. Handler: vm.DeleteVolumeHandler(serverCtx),
  483. },
  484. {
  485. Method: http.MethodPost,
  486. Path: "/vm/createVolume",
  487. Handler: vm.CreateVolumeHandler(serverCtx),
  488. },
  489. {
  490. Method: http.MethodGet,
  491. Path: "/vm/listFlavorsDetail",
  492. Handler: vm.ListFlavorsDetailHandler(serverCtx),
  493. },
  494. {
  495. Method: http.MethodGet,
  496. Path: "/vm/listVolumeTypes",
  497. Handler: vm.ListVolumeTypesHandler(serverCtx),
  498. },
  499. {
  500. Method: http.MethodPut,
  501. Path: "/vm/updateVolume",
  502. Handler: vm.UpdateVolumeHandler(serverCtx),
  503. },
  504. {
  505. Method: http.MethodPost,
  506. Path: "/vm/createVolumeTypes",
  507. Handler: vm.CreateVolumeTypesHandler(serverCtx),
  508. },
  509. {
  510. Method: http.MethodDelete,
  511. Path: "/vm/deleteVolumeType",
  512. Handler: vm.DeleteVolumeTypeHandler(serverCtx),
  513. },
  514. {
  515. Method: http.MethodGet,
  516. Path: "/vm/listVolumes",
  517. Handler: vm.ListVolumesHandler(serverCtx),
  518. },
  519. {
  520. Method: http.MethodGet,
  521. Path: "/vm/getVolumeDetailedById",
  522. Handler: vm.GetVolumeDetailedByIdHandler(serverCtx),
  523. },
  524. {
  525. Method: http.MethodGet,
  526. Path: "/vm/listNodes",
  527. Handler: vm.ListNodesHandler(serverCtx),
  528. },
  529. {
  530. Method: http.MethodPost,
  531. Path: "/vm/createNode",
  532. Handler: vm.CreateNodeHandler(serverCtx),
  533. },
  534. {
  535. Method: http.MethodDelete,
  536. Path: "/vm/deleteNode",
  537. Handler: vm.DeleteNodeHandler(serverCtx),
  538. },
  539. {
  540. Method: http.MethodGet,
  541. Path: "/vm/showNodeDetails",
  542. Handler: vm.ShowNodeDetailsHandler(serverCtx),
  543. },
  544. },
  545. rest.WithPrefix("/pcm/v1"),
  546. )
  547. server.AddRoutes(
  548. []rest.Route{
  549. {
  550. Method: http.MethodPost,
  551. Path: "/storelink/uploadImage",
  552. Handler: storelink.UploadLinkImageHandler(serverCtx),
  553. },
  554. {
  555. Method: http.MethodGet,
  556. Path: "/storelink/getImageList",
  557. Handler: storelink.GetLinkImageListHandler(serverCtx),
  558. },
  559. {
  560. Method: http.MethodDelete,
  561. Path: "/storelink/deleteImage",
  562. Handler: storelink.DeleteLinkImageHandler(serverCtx),
  563. },
  564. {
  565. Method: http.MethodPost,
  566. Path: "/storelink/submitTask",
  567. Handler: storelink.SubmitLinkTaskHandler(serverCtx),
  568. },
  569. {
  570. Method: http.MethodGet,
  571. Path: "/storelink/getTask",
  572. Handler: storelink.GetLinkTaskHandler(serverCtx),
  573. },
  574. {
  575. Method: http.MethodDelete,
  576. Path: "/storelink/deleteTask",
  577. Handler: storelink.DeleteLinkTaskHandler(serverCtx),
  578. },
  579. {
  580. Method: http.MethodGet,
  581. Path: "/storelink/getParticipants",
  582. Handler: storelink.GetParticipantsHandler(serverCtx),
  583. },
  584. {
  585. Method: http.MethodGet,
  586. Path: "/storelink/getResourceSpecs",
  587. Handler: storelink.GetAISpecsHandler(serverCtx),
  588. },
  589. },
  590. rest.WithPrefix("/pcm/v1"),
  591. )
  592. }

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.