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

2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794
  1. // Code generated by goctl. DO NOT EDIT.
  2. package handler
  3. import (
  4. "net/http"
  5. adapters "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/adapters"
  6. ai "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/ai"
  7. apps "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/apps"
  8. cloud "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/cloud"
  9. core "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/core"
  10. hpc "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/hpc"
  11. image "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/image"
  12. schedule "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/schedule"
  13. storage "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/storage"
  14. storelink "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/storelink"
  15. vm "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/handler/vm"
  16. "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
  17. "github.com/zeromicro/go-zero/rest"
  18. )
  19. func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
  20. server.AddRoutes(
  21. []rest.Route{
  22. {
  23. Method: http.MethodGet,
  24. Path: "/core/participantList",
  25. Handler: core.ParticipantListHandler(serverCtx),
  26. },
  27. {
  28. Method: http.MethodPost,
  29. Path: "/core/scheduleTaskByYaml",
  30. Handler: core.ScheduleTaskByYamlHandler(serverCtx),
  31. },
  32. {
  33. Method: http.MethodPost,
  34. Path: "/core/commitTask",
  35. Handler: core.CommitTaskHandler(serverCtx),
  36. },
  37. {
  38. Method: http.MethodPost,
  39. Path: "/core/commitHpcTask",
  40. Handler: core.CommitHpcTaskHandler(serverCtx),
  41. },
  42. {
  43. Method: http.MethodPost,
  44. Path: "/core/commitVmTask",
  45. Handler: core.CommitVmTaskHandler(serverCtx),
  46. },
  47. {
  48. Method: http.MethodDelete,
  49. Path: "/core/deleteTask/:id",
  50. Handler: core.DeleteTaskHandler(serverCtx),
  51. },
  52. {
  53. Method: http.MethodGet,
  54. Path: "/core/taskList",
  55. Handler: core.TaskListHandler(serverCtx),
  56. },
  57. {
  58. Method: http.MethodGet,
  59. Path: "/core/taskDetail/:taskId",
  60. Handler: core.TaskDetailHandler(serverCtx),
  61. },
  62. {
  63. Method: http.MethodGet,
  64. Path: "/core/jobTotal",
  65. Handler: core.JobTotalHandler(serverCtx),
  66. },
  67. {
  68. Method: http.MethodGet,
  69. Path: "/core/listCenter",
  70. Handler: core.ListCenterHandler(serverCtx),
  71. },
  72. {
  73. Method: http.MethodGet,
  74. Path: "/core/listCluster/:centerId",
  75. Handler: core.ListClusterHandler(serverCtx),
  76. },
  77. {
  78. Method: http.MethodPost,
  79. Path: "/core/submitJob",
  80. Handler: core.SubmitJobHandler(serverCtx),
  81. },
  82. {
  83. Method: http.MethodGet,
  84. Path: "/core/getRegion",
  85. Handler: core.GetRegionHandler(serverCtx),
  86. },
  87. {
  88. Method: http.MethodGet,
  89. Path: "/core/listRegion",
  90. Handler: core.ListRegionHandler(serverCtx),
  91. },
  92. {
  93. Method: http.MethodGet,
  94. Path: "/core/getComputingPower",
  95. Handler: core.GetComputingPowerHandler(serverCtx),
  96. },
  97. {
  98. Method: http.MethodGet,
  99. Path: "/core/getGeneralInfo",
  100. Handler: core.GetGeneralInfoHandler(serverCtx),
  101. },
  102. {
  103. Method: http.MethodGet,
  104. Path: "/core/listDomainResource",
  105. Handler: core.ListDomainResourceHandler(serverCtx),
  106. },
  107. {
  108. Method: http.MethodGet,
  109. Path: "/core/getResourcePanelConfigHandler",
  110. Handler: core.GetResourcePanelConfigHandler(serverCtx),
  111. },
  112. {
  113. Method: http.MethodPut,
  114. Path: "/core/resourcePanelConfigHandler",
  115. Handler: core.PutResourcePanelConfigHandler(serverCtx),
  116. },
  117. {
  118. Method: http.MethodGet,
  119. Path: "/core/getComputilityStatistics",
  120. Handler: core.GetComputilityStatisticsHandler(serverCtx),
  121. },
  122. {
  123. Method: http.MethodGet,
  124. Path: "/core/assets",
  125. Handler: core.NodeAssetsHandler(serverCtx),
  126. },
  127. {
  128. Method: http.MethodGet,
  129. Path: "/core/centerResources",
  130. Handler: core.CenterResourcesHandler(serverCtx),
  131. },
  132. },
  133. rest.WithPrefix("/pcm/v1"),
  134. )
  135. server.AddRoutes(
  136. []rest.Route{
  137. {
  138. Method: http.MethodGet,
  139. Path: "/hpc/listJob",
  140. Handler: hpc.ListJobHandler(serverCtx),
  141. },
  142. {
  143. Method: http.MethodGet,
  144. Path: "/hpc/listHistoryJob",
  145. Handler: hpc.ListHistoryJobHandler(serverCtx),
  146. },
  147. {
  148. Method: http.MethodGet,
  149. Path: "/queue/assets",
  150. Handler: hpc.QueueAssetsHandler(serverCtx),
  151. },
  152. },
  153. rest.WithPrefix("/pcm/v1"),
  154. )
  155. server.AddRoutes(
  156. []rest.Route{
  157. {
  158. Method: http.MethodGet,
  159. Path: "/task/list",
  160. Handler: cloud.CloudListHandler(serverCtx),
  161. },
  162. {
  163. Method: http.MethodGet,
  164. Path: "/cloud/DeleteYaml",
  165. Handler: cloud.DeleteYamlHandler(serverCtx),
  166. },
  167. {
  168. Method: http.MethodGet,
  169. Path: "/cloud/controller/Metrics",
  170. Handler: cloud.ControllerMetricsHandler(serverCtx),
  171. },
  172. {
  173. Method: http.MethodPost,
  174. Path: "/cloud/registerCluster",
  175. Handler: cloud.RegisterClusterHandler(serverCtx),
  176. },
  177. {
  178. Method: http.MethodPost,
  179. Path: "/cloud/deleteCluster",
  180. Handler: cloud.DeleteClusterHandler(serverCtx),
  181. },
  182. {
  183. Method: http.MethodGet,
  184. Path: "/cloud/noticeTenant",
  185. Handler: cloud.NoticeTenantHandler(serverCtx),
  186. },
  187. {
  188. Method: http.MethodPost,
  189. Path: "/cloud/updateTenant",
  190. Handler: cloud.UpdateTenantHandler(serverCtx),
  191. },
  192. {
  193. Method: http.MethodGet,
  194. Path: "/core/clusterList",
  195. Handler: cloud.GetClusterListHandler(serverCtx),
  196. },
  197. },
  198. rest.WithPrefix("/pcm/v1"),
  199. )
  200. server.AddRoutes(
  201. []rest.Route{
  202. {
  203. Method: http.MethodGet,
  204. Path: "/ai/listDataSet/:projectId",
  205. Handler: ai.ListDataSetHandler(serverCtx),
  206. },
  207. {
  208. Method: http.MethodPost,
  209. Path: "/ai/createDataSet/:projectId",
  210. Handler: ai.CreateDataSetHandler(serverCtx),
  211. },
  212. {
  213. Method: http.MethodDelete,
  214. Path: "/ai/deleteDataSet/:projectId/:datasetId",
  215. Handler: ai.DeleteDataSetHandler(serverCtx),
  216. },
  217. {
  218. Method: http.MethodPost,
  219. Path: "/ai/CreateTask/:projectId/:datasetId",
  220. Handler: ai.CreateTaskHandler(serverCtx),
  221. },
  222. {
  223. Method: http.MethodGet,
  224. Path: "/ai/ListImport/:projectId/:datasetId",
  225. Handler: ai.ListImportHandler(serverCtx),
  226. },
  227. {
  228. Method: http.MethodGet,
  229. Path: "/ai/GetListTrainingJobs/:projectId",
  230. Handler: ai.GetListTrainingJobsHandler(serverCtx),
  231. },
  232. {
  233. Method: http.MethodDelete,
  234. Path: "/ai/DeleteTrainingJob/:projectId/:trainingJobId",
  235. Handler: ai.DeleteTrainingJobHandler(serverCtx),
  236. },
  237. {
  238. Method: http.MethodPost,
  239. Path: "/ai/CreateAlgorithm/:projectId",
  240. Handler: ai.CreateAlgorithmHandler(serverCtx),
  241. },
  242. {
  243. Method: http.MethodGet,
  244. Path: "/ai/ListAlgorithms/:projectId",
  245. Handler: ai.ListAlgorithmsHandler(serverCtx),
  246. },
  247. {
  248. Method: http.MethodDelete,
  249. Path: "/ai/DeleteAlgorithm/:projectId/:algorithmId",
  250. Handler: ai.DeleteAlgorithmHandler(serverCtx),
  251. },
  252. {
  253. Method: http.MethodPost,
  254. Path: "/ai/CreateTrainingJob/:projectId",
  255. Handler: ai.CreateTrainingJobHandler(serverCtx),
  256. },
  257. {
  258. Method: http.MethodGet,
  259. Path: "/ai/ShowAlgorithmByUuid/:projectId/:algorithmId",
  260. Handler: ai.ShowAlgorithmByUuidHandler(serverCtx),
  261. },
  262. {
  263. Method: http.MethodPost,
  264. Path: "/ai/CreateExportTask/:projectId/:datasetId",
  265. Handler: ai.CreateExportTaskHandler(serverCtx),
  266. },
  267. {
  268. Method: http.MethodGet,
  269. Path: "/ai/GetExportTasksOfDataset/:projectId/:datasetId",
  270. Handler: ai.GetExportTasksOfDatasetHandler(serverCtx),
  271. },
  272. {
  273. Method: http.MethodGet,
  274. Path: "/ai/GetExportTaskStatusOfDataset/:projectId/:resourceId/:taskId",
  275. Handler: ai.GetExportTaskStatusOfDatasetHandler(serverCtx),
  276. },
  277. {
  278. Method: http.MethodPost,
  279. Path: "/ai/CreateProcessorTask",
  280. Handler: ai.CreateProcessorTaskHandler(serverCtx),
  281. },
  282. {
  283. Method: http.MethodPost,
  284. Path: "/ai/CreateService/:projectId",
  285. Handler: ai.CreateServiceHandler(serverCtx),
  286. },
  287. {
  288. Method: http.MethodGet,
  289. Path: "/ai/ListServices/:projectId",
  290. Handler: ai.ListServicesHandler(serverCtx),
  291. },
  292. {
  293. Method: http.MethodGet,
  294. Path: "/ai/ShowService/:projectId/:serviceId",
  295. Handler: ai.ShowServiceHandler(serverCtx),
  296. },
  297. {
  298. Method: http.MethodDelete,
  299. Path: "/ai/DeleteService/:projectId/:serviceId",
  300. Handler: ai.DeleteServiceHandler(serverCtx),
  301. },
  302. {
  303. Method: http.MethodGet,
  304. Path: "/ai/ListClusters",
  305. Handler: ai.ListClustersHandler(serverCtx),
  306. },
  307. {
  308. Method: http.MethodGet,
  309. Path: "/ai/listNotebook",
  310. Handler: ai.ListNotebookHandler(serverCtx),
  311. },
  312. {
  313. Method: http.MethodPost,
  314. Path: "/ai/createNotebook",
  315. Handler: ai.CreateNotebookHandler(serverCtx),
  316. },
  317. {
  318. Method: http.MethodPost,
  319. Path: "/ai/startNotebook",
  320. Handler: ai.StartNotebookHandler(serverCtx),
  321. },
  322. {
  323. Method: http.MethodPost,
  324. Path: "/ai/stopNotebook",
  325. Handler: ai.StopNotebookHandler(serverCtx),
  326. },
  327. {
  328. Method: http.MethodGet,
  329. Path: "/ai/getNotebookStorage",
  330. Handler: ai.GetNotebookStorageHandler(serverCtx),
  331. },
  332. {
  333. Method: http.MethodPost,
  334. Path: "/ai/mountNotebookStorage",
  335. Handler: ai.MountNotebookStorageHandler(serverCtx),
  336. },
  337. {
  338. Method: http.MethodGet,
  339. Path: "/ai/getVisualizationJob",
  340. Handler: ai.GetVisualizationJobHandler(serverCtx),
  341. },
  342. {
  343. Method: http.MethodPost,
  344. Path: "/ai/CreateVisualizationJob",
  345. Handler: ai.CreateVisualizationJobHandler(serverCtx),
  346. },
  347. },
  348. rest.WithPrefix("/pcm/v1"),
  349. )
  350. server.AddRoutes(
  351. []rest.Route{
  352. {
  353. Method: http.MethodGet,
  354. Path: "/storage/screenStorage",
  355. Handler: storage.ScreenStorageHandler(serverCtx),
  356. },
  357. {
  358. Method: http.MethodGet,
  359. Path: "/storage/dailyPowerScreen",
  360. Handler: storage.DailyPowerScreenHandler(serverCtx),
  361. },
  362. {
  363. Method: http.MethodGet,
  364. Path: "/storage/perCenterComputerPowers",
  365. Handler: storage.PerCenterComputerPowersHandler(serverCtx),
  366. },
  367. },
  368. rest.WithPrefix("/pcm/v1"),
  369. )
  370. server.AddRoutes(
  371. []rest.Route{
  372. {
  373. Method: http.MethodPost,
  374. Path: "/upload",
  375. Handler: image.UploadHandler(serverCtx),
  376. },
  377. {
  378. Method: http.MethodPost,
  379. Path: "/chunk",
  380. Handler: image.ChunkHandler(serverCtx),
  381. },
  382. {
  383. Method: http.MethodGet,
  384. Path: "/image/list",
  385. Handler: image.ImageListHandler(serverCtx),
  386. },
  387. {
  388. Method: http.MethodGet,
  389. Path: "/dataSet/check/:fileMd5",
  390. Handler: image.DataSetCheckHandler(serverCtx),
  391. },
  392. {
  393. Method: http.MethodPost,
  394. Path: "/dataSet/upload",
  395. Handler: image.UploadDataSetHandler(serverCtx),
  396. },
  397. },
  398. rest.WithPrefix("/pcm/v1"),
  399. )
  400. server.AddRoutes(
  401. []rest.Route{
  402. {
  403. Method: http.MethodGet,
  404. Path: "/vm/getComputeLimits",
  405. Handler: vm.GetComputeLimitsHandler(serverCtx),
  406. },
  407. {
  408. Method: http.MethodGet,
  409. Path: "/vm/getVolumeLimits",
  410. Handler: vm.GetVolumeLimitsHandler(serverCtx),
  411. },
  412. {
  413. Method: http.MethodGet,
  414. Path: "/vm/listServer",
  415. Handler: vm.ListServerHandler(serverCtx),
  416. },
  417. {
  418. Method: http.MethodGet,
  419. Path: "/vm/listServersDetailed",
  420. Handler: vm.ListServersDetailedHandler(serverCtx),
  421. },
  422. {
  423. Method: http.MethodDelete,
  424. Path: "/vm/deleteServer",
  425. Handler: vm.DeleteServerHandler(serverCtx),
  426. },
  427. {
  428. Method: http.MethodPost,
  429. Path: "/vm/createServer",
  430. Handler: vm.CreateServerHandler(serverCtx),
  431. },
  432. {
  433. Method: http.MethodGet,
  434. Path: "/vm/getServersDetailedById",
  435. Handler: vm.GetServersDetailedByIdHandler(serverCtx),
  436. },
  437. {
  438. Method: http.MethodPut,
  439. Path: "/vm/updateServer",
  440. Handler: vm.UpdateServerHandler(serverCtx),
  441. },
  442. {
  443. Method: http.MethodPost,
  444. Path: "/vm/startServer",
  445. Handler: vm.StartServerHandler(serverCtx),
  446. },
  447. {
  448. Method: http.MethodPost,
  449. Path: "/vm/stopServer",
  450. Handler: vm.StopServerHandler(serverCtx),
  451. },
  452. {
  453. Method: http.MethodPost,
  454. Path: "/vm/rebootServer",
  455. Handler: vm.RebootServerHandler(serverCtx),
  456. },
  457. {
  458. Method: http.MethodPost,
  459. Path: "/vm/pauseServer",
  460. Handler: vm.PauseServerHandler(serverCtx),
  461. },
  462. {
  463. Method: http.MethodGet,
  464. Path: "/vm/listImages",
  465. Handler: vm.ListImagesHandler(serverCtx),
  466. },
  467. {
  468. Method: http.MethodDelete,
  469. Path: "/vm/deleteImage",
  470. Handler: vm.DeleteImageHandler(serverCtx),
  471. },
  472. {
  473. Method: http.MethodPost,
  474. Path: "/vm/createImage",
  475. Handler: vm.CreateImageHandler(serverCtx),
  476. },
  477. {
  478. Method: http.MethodPut,
  479. Path: "/vm/uploadImage",
  480. Handler: vm.UploadImageHandler(serverCtx),
  481. },
  482. {
  483. Method: http.MethodGet,
  484. Path: "/vm/listNetworks",
  485. Handler: vm.ListNetworksHandler(serverCtx),
  486. },
  487. {
  488. Method: http.MethodDelete,
  489. Path: "/vm/deleteNetwork",
  490. Handler: vm.DeleteNetworkHandler(serverCtx),
  491. },
  492. {
  493. Method: http.MethodPost,
  494. Path: "/vm/createNetwork",
  495. Handler: vm.CreateNetworkHandler(serverCtx),
  496. },
  497. {
  498. Method: http.MethodPost,
  499. Path: "/vm/createSubnet",
  500. Handler: vm.CreateSubnetHandler(serverCtx),
  501. },
  502. {
  503. Method: http.MethodGet,
  504. Path: "/vm/showNetworkDetails",
  505. Handler: vm.ShowNetworkDetailsHandler(serverCtx),
  506. },
  507. {
  508. Method: http.MethodPut,
  509. Path: "/vm/updateNetwork",
  510. Handler: vm.UpdateNetworkHandler(serverCtx),
  511. },
  512. {
  513. Method: http.MethodPost,
  514. Path: "/vm/bulkCreateNetworks",
  515. Handler: vm.BulkCreateNetworksHandler(serverCtx),
  516. },
  517. {
  518. Method: http.MethodGet,
  519. Path: "/vm/listVolumesDetail",
  520. Handler: vm.ListVolumesDetailHandler(serverCtx),
  521. },
  522. {
  523. Method: http.MethodDelete,
  524. Path: "/vm/deleteVolume",
  525. Handler: vm.DeleteVolumeHandler(serverCtx),
  526. },
  527. {
  528. Method: http.MethodPost,
  529. Path: "/vm/createVolume",
  530. Handler: vm.CreateVolumeHandler(serverCtx),
  531. },
  532. {
  533. Method: http.MethodGet,
  534. Path: "/vm/listFlavorsDetail",
  535. Handler: vm.ListFlavorsDetailHandler(serverCtx),
  536. },
  537. {
  538. Method: http.MethodGet,
  539. Path: "/vm/listVolumeTypes",
  540. Handler: vm.ListVolumeTypesHandler(serverCtx),
  541. },
  542. {
  543. Method: http.MethodPut,
  544. Path: "/vm/updateVolume",
  545. Handler: vm.UpdateVolumeHandler(serverCtx),
  546. },
  547. {
  548. Method: http.MethodPost,
  549. Path: "/vm/createVolumeTypes",
  550. Handler: vm.CreateVolumeTypesHandler(serverCtx),
  551. },
  552. {
  553. Method: http.MethodDelete,
  554. Path: "/vm/deleteVolumeType",
  555. Handler: vm.DeleteVolumeTypeHandler(serverCtx),
  556. },
  557. {
  558. Method: http.MethodGet,
  559. Path: "/vm/listVolumes",
  560. Handler: vm.ListVolumesHandler(serverCtx),
  561. },
  562. {
  563. Method: http.MethodGet,
  564. Path: "/vm/getVolumeDetailedById",
  565. Handler: vm.GetVolumeDetailedByIdHandler(serverCtx),
  566. },
  567. {
  568. Method: http.MethodGet,
  569. Path: "/vm/listNodes",
  570. Handler: vm.ListNodesHandler(serverCtx),
  571. },
  572. {
  573. Method: http.MethodPost,
  574. Path: "/vm/createNode",
  575. Handler: vm.CreateNodeHandler(serverCtx),
  576. },
  577. {
  578. Method: http.MethodDelete,
  579. Path: "/vm/deleteNode",
  580. Handler: vm.DeleteNodeHandler(serverCtx),
  581. },
  582. {
  583. Method: http.MethodGet,
  584. Path: "/vm/showNodeDetails",
  585. Handler: vm.ShowNodeDetailsHandler(serverCtx),
  586. },
  587. },
  588. rest.WithPrefix("/pcm/v1"),
  589. )
  590. server.AddRoutes(
  591. []rest.Route{
  592. {
  593. Method: http.MethodPost,
  594. Path: "/storelink/uploadImage",
  595. Handler: storelink.UploadLinkImageHandler(serverCtx),
  596. },
  597. {
  598. Method: http.MethodGet,
  599. Path: "/storelink/getImageList",
  600. Handler: storelink.GetLinkImageListHandler(serverCtx),
  601. },
  602. {
  603. Method: http.MethodDelete,
  604. Path: "/storelink/deleteImage",
  605. Handler: storelink.DeleteLinkImageHandler(serverCtx),
  606. },
  607. {
  608. Method: http.MethodPost,
  609. Path: "/storelink/submitTask",
  610. Handler: storelink.SubmitLinkTaskHandler(serverCtx),
  611. },
  612. {
  613. Method: http.MethodGet,
  614. Path: "/storelink/getTask",
  615. Handler: storelink.GetLinkTaskHandler(serverCtx),
  616. },
  617. {
  618. Method: http.MethodDelete,
  619. Path: "/storelink/deleteTask",
  620. Handler: storelink.DeleteLinkTaskHandler(serverCtx),
  621. },
  622. {
  623. Method: http.MethodGet,
  624. Path: "/storelink/getParticipants",
  625. Handler: storelink.GetParticipantsHandler(serverCtx),
  626. },
  627. {
  628. Method: http.MethodGet,
  629. Path: "/storelink/getResourceSpecs",
  630. Handler: storelink.GetAISpecsHandler(serverCtx),
  631. },
  632. },
  633. rest.WithPrefix("/pcm/v1"),
  634. )
  635. server.AddRoutes(
  636. []rest.Route{
  637. {
  638. Method: http.MethodGet,
  639. Path: "/apps/list",
  640. Handler: apps.AppListHandler(serverCtx),
  641. },
  642. {
  643. Method: http.MethodGet,
  644. Path: "/apps/distribute/:appName",
  645. Handler: apps.AppDetailHandler(serverCtx),
  646. },
  647. {
  648. Method: http.MethodGet,
  649. Path: "/apps/pods/:appName",
  650. Handler: apps.AppPodsHandler(serverCtx),
  651. },
  652. {
  653. Method: http.MethodGet,
  654. Path: "/apps/getAppByAppName/:appName",
  655. Handler: apps.GetAppByAppNameHandler(serverCtx),
  656. },
  657. {
  658. Method: http.MethodDelete,
  659. Path: "/apps/deleteApp",
  660. Handler: apps.DeleteAppByAppNameHandler(serverCtx),
  661. },
  662. {
  663. Method: http.MethodPut,
  664. Path: "/apps/updateApp",
  665. Handler: apps.UpdateAppByAppNameHandler(serverCtx),
  666. },
  667. {
  668. Method: http.MethodPut,
  669. Path: "/apps/restartApp",
  670. Handler: apps.RestartAppByAppNameHandler(serverCtx),
  671. },
  672. {
  673. Method: http.MethodPut,
  674. Path: "/apps/pauseApp",
  675. Handler: apps.PauseAppByAppNameHandler(serverCtx),
  676. },
  677. {
  678. Method: http.MethodPut,
  679. Path: "/apps/startApp",
  680. Handler: apps.StartAppByAppNameHandler(serverCtx),
  681. },
  682. },
  683. rest.WithPrefix("/pcm/v1"),
  684. )
  685. server.AddRoutes(
  686. []rest.Route{
  687. {
  688. Method: http.MethodGet,
  689. Path: "/adapter/list",
  690. Handler: adapters.AdaptersListHandler(serverCtx),
  691. },
  692. {
  693. Method: http.MethodPost,
  694. Path: "/adapter/create",
  695. Handler: adapters.CreateAdapterHandler(serverCtx),
  696. },
  697. {
  698. Method: http.MethodPut,
  699. Path: "/adapter/update",
  700. Handler: adapters.UpdateAdapterHandler(serverCtx),
  701. },
  702. {
  703. Method: http.MethodDelete,
  704. Path: "/adapter/delete",
  705. Handler: adapters.DeleteAdapterHandler(serverCtx),
  706. },
  707. {
  708. Method: http.MethodGet,
  709. Path: "/adapter/get",
  710. Handler: adapters.GetAdapterHandler(serverCtx),
  711. },
  712. {
  713. Method: http.MethodGet,
  714. Path: "/adapter/cluster/list",
  715. Handler: adapters.ClusterListHandler(serverCtx),
  716. },
  717. {
  718. Method: http.MethodPost,
  719. Path: "/adapter/cluster/create",
  720. Handler: adapters.CreateClusterHandler(serverCtx),
  721. },
  722. {
  723. Method: http.MethodPut,
  724. Path: "/adapter/cluster/update",
  725. Handler: adapters.UpdateClusterHandler(serverCtx),
  726. },
  727. {
  728. Method: http.MethodDelete,
  729. Path: "/adapter/cluster/delete",
  730. Handler: adapters.DeleteClusterHandler(serverCtx),
  731. },
  732. {
  733. Method: http.MethodGet,
  734. Path: "/adapter/cluster/get",
  735. Handler: adapters.GetClusterHandler(serverCtx),
  736. },
  737. {
  738. Method: http.MethodGet,
  739. Path: "/adapter/relation",
  740. Handler: adapters.GetAdapterClusterHandler(serverCtx),
  741. },
  742. {
  743. Method: http.MethodGet,
  744. Path: "/adapter/clusterSum",
  745. Handler: adapters.GetClusterSumHandler(serverCtx),
  746. },
  747. },
  748. rest.WithPrefix("/pcm/v1"),
  749. )
  750. server.AddRoutes(
  751. []rest.Route{
  752. {
  753. Method: http.MethodGet,
  754. Path: "/schedule/ai/getResourceTypes",
  755. Handler: schedule.ScheduleGetAiResourceTypesHandler(serverCtx),
  756. },
  757. {
  758. Method: http.MethodGet,
  759. Path: "/schedule/ai/getTaskTypes",
  760. Handler: schedule.ScheduleGetAiTaskTypesHandler(serverCtx),
  761. },
  762. {
  763. Method: http.MethodGet,
  764. Path: "/schedule/ai/getDatasets",
  765. Handler: schedule.ScheduleGetDatasetsHandler(serverCtx),
  766. },
  767. {
  768. Method: http.MethodGet,
  769. Path: "/schedule/ai/getStrategies",
  770. Handler: schedule.ScheduleGetStrategyHandler(serverCtx),
  771. },
  772. {
  773. Method: http.MethodPost,
  774. Path: "/schedule/submit",
  775. Handler: schedule.ScheduleSubmitHandler(serverCtx),
  776. },
  777. },
  778. rest.WithPrefix("/pcm/v1"),
  779. )
  780. }

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.