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

2 years ago
2 years ago
11 months ago
11 months ago
11 months ago
2 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690
  1. // Code generated by goctl. DO NOT EDIT.
  2. package handler
  3. import (
  4. "net/http"
  5. adapters "gitlink.org.cn/JointCloud/pcm-coordinator/internal/handler/adapters"
  6. ai "gitlink.org.cn/JointCloud/pcm-coordinator/internal/handler/ai"
  7. cloud "gitlink.org.cn/JointCloud/pcm-coordinator/internal/handler/cloud"
  8. core "gitlink.org.cn/JointCloud/pcm-coordinator/internal/handler/core"
  9. dictionary "gitlink.org.cn/JointCloud/pcm-coordinator/internal/handler/dictionary"
  10. hpc "gitlink.org.cn/JointCloud/pcm-coordinator/internal/handler/hpc"
  11. inference "gitlink.org.cn/JointCloud/pcm-coordinator/internal/handler/inference"
  12. monitoring "gitlink.org.cn/JointCloud/pcm-coordinator/internal/handler/monitoring"
  13. schedule "gitlink.org.cn/JointCloud/pcm-coordinator/internal/handler/schedule"
  14. storage "gitlink.org.cn/JointCloud/pcm-coordinator/internal/handler/storage"
  15. storelink "gitlink.org.cn/JointCloud/pcm-coordinator/internal/handler/storelink"
  16. vm "gitlink.org.cn/JointCloud/pcm-coordinator/internal/handler/vm"
  17. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/svc"
  18. "github.com/zeromicro/go-zero/rest"
  19. )
  20. func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
  21. server.AddRoutes(
  22. []rest.Route{
  23. {
  24. Method: http.MethodPost,
  25. Path: "/adapter/cluster/create",
  26. Handler: adapters.CreateClusterHandler(serverCtx),
  27. },
  28. {
  29. Method: http.MethodDelete,
  30. Path: "/adapter/cluster/delete",
  31. Handler: adapters.DeleteClusterHandler(serverCtx),
  32. },
  33. {
  34. Method: http.MethodGet,
  35. Path: "/adapter/cluster/get",
  36. Handler: adapters.GetClusterHandler(serverCtx),
  37. },
  38. {
  39. Method: http.MethodGet,
  40. Path: "/adapter/cluster/list",
  41. Handler: adapters.ClusterListHandler(serverCtx),
  42. },
  43. {
  44. Method: http.MethodPut,
  45. Path: "/adapter/cluster/update",
  46. Handler: adapters.UpdateClusterHandler(serverCtx),
  47. },
  48. {
  49. Method: http.MethodGet,
  50. Path: "/adapter/clusterSum",
  51. Handler: adapters.GetClusterSumHandler(serverCtx),
  52. },
  53. {
  54. Method: http.MethodPost,
  55. Path: "/adapter/create",
  56. Handler: adapters.CreateAdapterHandler(serverCtx),
  57. },
  58. {
  59. Method: http.MethodDelete,
  60. Path: "/adapter/delete",
  61. Handler: adapters.DeleteAdapterHandler(serverCtx),
  62. },
  63. {
  64. Method: http.MethodGet,
  65. Path: "/adapter/get",
  66. Handler: adapters.GetAdapterHandler(serverCtx),
  67. },
  68. {
  69. Method: http.MethodGet,
  70. Path: "/adapter/getAdapterInfo",
  71. Handler: adapters.GetAdapterInfoHandler(serverCtx),
  72. },
  73. {
  74. Method: http.MethodGet,
  75. Path: "/adapter/list",
  76. Handler: adapters.AdaptersListHandler(serverCtx),
  77. },
  78. {
  79. Method: http.MethodGet,
  80. Path: "/adapter/relation",
  81. Handler: adapters.GetAdapterRelationHandler(serverCtx),
  82. },
  83. {
  84. Method: http.MethodPut,
  85. Path: "/adapter/update",
  86. Handler: adapters.UpdateAdapterHandler(serverCtx),
  87. },
  88. },
  89. rest.WithPrefix("/pcm/v1"),
  90. )
  91. server.AddRoutes(
  92. []rest.Route{
  93. {
  94. // 创建算法
  95. Method: http.MethodPost,
  96. Path: "/ai/CreateAlgorithm/:projectId",
  97. Handler: ai.CreateAlgorithmHandler(serverCtx),
  98. },
  99. {
  100. // 创建导出任务
  101. Method: http.MethodPost,
  102. Path: "/ai/CreateExportTask/:projectId/:datasetId",
  103. Handler: ai.CreateExportTaskHandler(serverCtx),
  104. },
  105. {
  106. // 创建处理任务
  107. Method: http.MethodPost,
  108. Path: "/ai/CreateProcessorTask",
  109. Handler: ai.CreateProcessorTaskHandler(serverCtx),
  110. },
  111. {
  112. // 创建服务
  113. Method: http.MethodPost,
  114. Path: "/ai/CreateService/:projectId",
  115. Handler: ai.CreateServiceHandler(serverCtx),
  116. },
  117. {
  118. // 创建导入任务
  119. Method: http.MethodPost,
  120. Path: "/ai/CreateTask/:projectId/:datasetId",
  121. Handler: ai.CreateTaskHandler(serverCtx),
  122. },
  123. {
  124. // 创建训练作业
  125. Method: http.MethodPost,
  126. Path: "/ai/CreateTrainingJob/:projectId",
  127. Handler: ai.CreateTrainingJobHandler(serverCtx),
  128. },
  129. {
  130. // 创建虚拟化任务
  131. Method: http.MethodPost,
  132. Path: "/ai/CreateVisualizationJob",
  133. Handler: ai.CreateVisualizationJobHandler(serverCtx),
  134. },
  135. {
  136. // 删除算法
  137. Method: http.MethodDelete,
  138. Path: "/ai/DeleteAlgorithm/:projectId/:algorithmId",
  139. Handler: ai.DeleteAlgorithmHandler(serverCtx),
  140. },
  141. {
  142. // 删除服务
  143. Method: http.MethodDelete,
  144. Path: "/ai/DeleteService/:projectId/:serviceId",
  145. Handler: ai.DeleteServiceHandler(serverCtx),
  146. },
  147. {
  148. // 删除训练作业
  149. Method: http.MethodDelete,
  150. Path: "/ai/DeleteTrainingJob/:projectId/:trainingJobId",
  151. Handler: ai.DeleteTrainingJobHandler(serverCtx),
  152. },
  153. {
  154. // 获取导出任务数据集状态
  155. Method: http.MethodGet,
  156. Path: "/ai/GetExportTaskStatusOfDataset/:projectId/:resourceId/:taskId",
  157. Handler: ai.GetExportTaskStatusOfDatasetHandler(serverCtx),
  158. },
  159. {
  160. // 获取导出任务数据集
  161. Method: http.MethodGet,
  162. Path: "/ai/GetExportTasksOfDataset/:projectId/:datasetId",
  163. Handler: ai.GetExportTasksOfDatasetHandler(serverCtx),
  164. },
  165. {
  166. // 查询训练作业列表
  167. Method: http.MethodGet,
  168. Path: "/ai/GetListTrainingJobs/:projectId",
  169. Handler: ai.GetListTrainingJobsHandler(serverCtx),
  170. },
  171. {
  172. // 查询创建算法列表
  173. Method: http.MethodGet,
  174. Path: "/ai/ListAlgorithms/:projectId",
  175. Handler: ai.ListAlgorithmsHandler(serverCtx),
  176. },
  177. {
  178. // 查询专属资源池列表
  179. Method: http.MethodGet,
  180. Path: "/ai/ListClusters",
  181. Handler: ai.ListClustersHandler(serverCtx),
  182. },
  183. {
  184. // 查询数据集导入任务列表
  185. Method: http.MethodGet,
  186. Path: "/ai/ListImport/:projectId/:datasetId",
  187. Handler: ai.ListImportHandler(serverCtx),
  188. },
  189. {
  190. // 展示服务
  191. Method: http.MethodGet,
  192. Path: "/ai/ListServices/:projectId",
  193. Handler: ai.ListServicesHandler(serverCtx),
  194. },
  195. {
  196. // 展示算法详情
  197. Method: http.MethodGet,
  198. Path: "/ai/ShowAlgorithmByUuid/:projectId/:algorithmId",
  199. Handler: ai.ShowAlgorithmByUuidHandler(serverCtx),
  200. },
  201. {
  202. // 展示服务详情
  203. Method: http.MethodGet,
  204. Path: "/ai/ShowService/:projectId/:serviceId",
  205. Handler: ai.ShowServiceHandler(serverCtx),
  206. },
  207. {
  208. // 文本识别
  209. Method: http.MethodPost,
  210. Path: "/ai/chat",
  211. Handler: ai.ChatHandler(serverCtx),
  212. },
  213. {
  214. // 创建数据集
  215. Method: http.MethodPost,
  216. Path: "/ai/createDataSet/:projectId",
  217. Handler: ai.CreateDataSetHandler(serverCtx),
  218. },
  219. {
  220. // 创建notebook
  221. Method: http.MethodPost,
  222. Path: "/ai/createNotebook",
  223. Handler: ai.CreateNotebookHandler(serverCtx),
  224. },
  225. {
  226. // 删除数据集
  227. Method: http.MethodDelete,
  228. Path: "/ai/deleteDataSet/:projectId/:datasetId",
  229. Handler: ai.DeleteDataSetHandler(serverCtx),
  230. },
  231. {
  232. // 智算中心列表
  233. Method: http.MethodGet,
  234. Path: "/ai/getCenterList",
  235. Handler: ai.GetCenterListHandler(serverCtx),
  236. },
  237. {
  238. // 智算中心概览
  239. Method: http.MethodGet,
  240. Path: "/ai/getCenterOverview",
  241. Handler: ai.GetCenterOverviewHandler(serverCtx),
  242. },
  243. {
  244. // 智算中心排队状况
  245. Method: http.MethodGet,
  246. Path: "/ai/getCenterQueueing",
  247. Handler: ai.GetCenterQueueingHandler(serverCtx),
  248. },
  249. {
  250. // 智算中心任务列表
  251. Method: http.MethodGet,
  252. Path: "/ai/getCenterTaskList",
  253. Handler: ai.GetCenterTaskListHandler(serverCtx),
  254. },
  255. {
  256. // 查询notebook存储
  257. Method: http.MethodGet,
  258. Path: "/ai/getNotebookStorage",
  259. Handler: ai.GetNotebookStorageHandler(serverCtx),
  260. },
  261. {
  262. // 获取虚拟化任务
  263. Method: http.MethodGet,
  264. Path: "/ai/getVisualizationJob",
  265. Handler: ai.GetVisualizationJobHandler(serverCtx),
  266. },
  267. {
  268. // 查询数据集列表
  269. Method: http.MethodGet,
  270. Path: "/ai/listDataSet/:projectId",
  271. Handler: ai.ListDataSetHandler(serverCtx),
  272. },
  273. {
  274. // 查询notebook列表
  275. Method: http.MethodGet,
  276. Path: "/ai/listNotebook",
  277. Handler: ai.ListNotebookHandler(serverCtx),
  278. },
  279. {
  280. // 挂载notebook存储
  281. Method: http.MethodPost,
  282. Path: "/ai/mountNotebookStorage",
  283. Handler: ai.MountNotebookStorageHandler(serverCtx),
  284. },
  285. {
  286. // 启动notebook
  287. Method: http.MethodPost,
  288. Path: "/ai/startNotebook",
  289. Handler: ai.StartNotebookHandler(serverCtx),
  290. },
  291. {
  292. // 停止notebook
  293. Method: http.MethodPost,
  294. Path: "/ai/stopNotebook",
  295. Handler: ai.StopNotebookHandler(serverCtx),
  296. },
  297. {
  298. // 训练任务统计
  299. Method: http.MethodGet,
  300. Path: "/ai/trainingTaskStat",
  301. Handler: ai.TrainingTaskStatHandler(serverCtx),
  302. },
  303. },
  304. rest.WithPrefix("/pcm/v1"),
  305. )
  306. server.AddRoutes(
  307. []rest.Route{
  308. {
  309. // yaml删除
  310. Method: http.MethodGet,
  311. Path: "/cloud/DeleteYaml",
  312. Handler: cloud.DeleteYamlHandler(serverCtx),
  313. },
  314. {
  315. // 控制器监控
  316. Method: http.MethodGet,
  317. Path: "/cloud/controller/Metrics",
  318. Handler: cloud.ControllerMetricsHandler(serverCtx),
  319. },
  320. {
  321. // 数算集群删除
  322. Method: http.MethodPost,
  323. Path: "/cloud/deleteCluster",
  324. Handler: cloud.DeleteClusterHandler(serverCtx),
  325. },
  326. {
  327. Method: http.MethodPost,
  328. Path: "/cloud/pod/logs",
  329. Handler: cloud.PodLogsHandler(serverCtx),
  330. },
  331. {
  332. Method: http.MethodGet,
  333. Path: "/cloud/pods/list",
  334. Handler: cloud.PodsListHandler(serverCtx),
  335. },
  336. {
  337. // 数算集群注册
  338. Method: http.MethodPost,
  339. Path: "/cloud/registerCluster",
  340. Handler: cloud.RegisterClusterHandler(serverCtx),
  341. },
  342. {
  343. // Create cloud computing common tasks
  344. Method: http.MethodPost,
  345. Path: "/cloud/task/create",
  346. Handler: cloud.CommitGeneralTaskHandler(serverCtx),
  347. },
  348. {
  349. // Obtain cluster list information according to adapterId
  350. Method: http.MethodGet,
  351. Path: "/core/clusterList",
  352. Handler: cloud.GetClusterListHandler(serverCtx),
  353. },
  354. {
  355. // 云算任务列表
  356. Method: http.MethodGet,
  357. Path: "/task/list",
  358. Handler: cloud.CloudListHandler(serverCtx),
  359. },
  360. },
  361. rest.WithPrefix("/pcm/v1"),
  362. )
  363. server.AddRoutes(
  364. []rest.Route{
  365. {
  366. // 取消资源规格告警
  367. Method: http.MethodPut,
  368. Path: "/core/ai/resourceSpec/cancelAlarm",
  369. Handler: core.CancelResourceSpecAlarmHandler(serverCtx),
  370. },
  371. {
  372. // 与Api接口对比集群资源规格
  373. Method: http.MethodGet,
  374. Path: "/core/ai/resourceSpec/compare",
  375. Handler: core.CompareResourceSpecHandler(serverCtx),
  376. },
  377. {
  378. // 删除资源规格
  379. Method: http.MethodDelete,
  380. Path: "/core/ai/resourceSpec/delete/:id",
  381. Handler: core.DeleteResourceSpecHandler(serverCtx),
  382. },
  383. {
  384. // 获取指定资源规格详情
  385. Method: http.MethodGet,
  386. Path: "/core/ai/resourceSpec/detail",
  387. Handler: core.DetailResourceSpecHandler(serverCtx),
  388. },
  389. {
  390. // 编辑资源规格
  391. Method: http.MethodPut,
  392. Path: "/core/ai/resourceSpec/edit",
  393. Handler: core.EditResourceSpecHandler(serverCtx),
  394. },
  395. {
  396. // 获取资源规格列表
  397. Method: http.MethodGet,
  398. Path: "/core/ai/resourceSpec/page",
  399. Handler: core.PageResourceRangeHandler(serverCtx),
  400. },
  401. {
  402. // 获取资源规格范围
  403. Method: http.MethodGet,
  404. Path: "/core/ai/resourceSpec/range",
  405. Handler: core.ResourceRangeHandler(serverCtx),
  406. },
  407. {
  408. // 同步指定资源规格
  409. Method: http.MethodPut,
  410. Path: "/core/ai/resourceSpec/sync",
  411. Handler: core.SyncResourceSpecHandler(serverCtx),
  412. },
  413. {
  414. // 获取节点资产
  415. Method: http.MethodGet,
  416. Path: "/core/assets",
  417. Handler: core.NodeAssetsHandler(serverCtx),
  418. },
  419. {
  420. // 异步提交智算任务
  421. Method: http.MethodPost,
  422. Path: "/core/asynCommitAiTask",
  423. Handler: core.AsynCommitAiTaskHandler(serverCtx),
  424. },
  425. {
  426. // Center Resources top3
  427. Method: http.MethodGet,
  428. Path: "/core/centerResources",
  429. Handler: core.CenterResourcesHandler(serverCtx),
  430. },
  431. {
  432. // 提交任务
  433. Method: http.MethodPost,
  434. Path: "/core/commitTask",
  435. Handler: core.CommitTaskHandler(serverCtx),
  436. },
  437. {
  438. // 提交虚拟机任务
  439. Method: http.MethodPost,
  440. Path: "/core/commitVmTask",
  441. Handler: core.CommitVmTaskHandler(serverCtx),
  442. },
  443. {
  444. // 删除任务
  445. Method: http.MethodDelete,
  446. Path: "/core/deleteTask/:id",
  447. Handler: core.DeleteTaskHandler(serverCtx),
  448. },
  449. {
  450. // 根据集群id获取集群信息
  451. Method: http.MethodGet,
  452. Path: "/core/getClusterById",
  453. Handler: core.GetClusterByIdHandler(serverCtx),
  454. },
  455. {
  456. // 获取算力统计信息
  457. Method: http.MethodGet,
  458. Path: "/core/getComputilityStatistics",
  459. Handler: core.GetComputilityStatisticsHandler(serverCtx),
  460. },
  461. {
  462. // 查询算力
  463. Method: http.MethodGet,
  464. Path: "/core/getComputingPower",
  465. Handler: core.GetComputingPowerHandler(serverCtx),
  466. },
  467. {
  468. // screen
  469. Method: http.MethodGet,
  470. Path: "/core/getDomainResource",
  471. Handler: core.GetDomainResourceHandler(serverCtx),
  472. },
  473. {
  474. // 查询通用信息
  475. Method: http.MethodGet,
  476. Path: "/core/getGeneralInfo",
  477. Handler: core.GetGeneralInfoHandler(serverCtx),
  478. },
  479. {
  480. // Get Public Flavor
  481. Method: http.MethodGet,
  482. Path: "/core/getPublicFlavor",
  483. Handler: core.GetPublicFlavorHandler(serverCtx),
  484. },
  485. {
  486. // Get Public Image
  487. Method: http.MethodGet,
  488. Path: "/core/getPublicImage",
  489. Handler: core.GetPublicImageHandler(serverCtx),
  490. },
  491. {
  492. // Get Public Network
  493. Method: http.MethodGet,
  494. Path: "/core/getPublicNetwork",
  495. Handler: core.GetPublicNetworkHandler(serverCtx),
  496. },
  497. {
  498. // 获取region
  499. Method: http.MethodGet,
  500. Path: "/core/getRegion",
  501. Handler: core.GetRegionHandler(serverCtx),
  502. },
  503. {
  504. // 查询控制面板配置信息
  505. Method: http.MethodGet,
  506. Path: "/core/getResourcePanelConfigHandler",
  507. Handler: core.GetResourcePanelConfigHandler(serverCtx),
  508. },
  509. {
  510. // screen
  511. Method: http.MethodGet,
  512. Path: "/core/getScreenChart",
  513. Handler: core.GetScreenChartHandler(serverCtx),
  514. },
  515. {
  516. // screen
  517. Method: http.MethodGet,
  518. Path: "/core/getScreenInfo",
  519. Handler: core.GetScreenInfoHandler(serverCtx),
  520. },
  521. {
  522. // Home Page Overview
  523. Method: http.MethodGet,
  524. Path: "/core/homeOverview",
  525. Handler: core.HomeOverviewHandler(serverCtx),
  526. },
  527. {
  528. // 任务概览
  529. Method: http.MethodGet,
  530. Path: "/core/jobTotal",
  531. Handler: core.JobTotalHandler(serverCtx),
  532. },
  533. {
  534. // 数据中心概览
  535. Method: http.MethodGet,
  536. Path: "/core/listCenter",
  537. Handler: core.ListCenterHandler(serverCtx),
  538. },
  539. {
  540. // 查询集群列表
  541. Method: http.MethodGet,
  542. Path: "/core/listCluster/:centerId",
  543. Handler: core.ListClusterHandler(serverCtx),
  544. },
  545. {
  546. // list notice
  547. Method: http.MethodGet,
  548. Path: "/core/listNotice",
  549. Handler: core.ListNoticeHandler(serverCtx),
  550. },
  551. {
  552. // 获取region列表
  553. Method: http.MethodGet,
  554. Path: "/core/listRegion",
  555. Handler: core.ListRegionHandler(serverCtx),
  556. },
  557. {
  558. // metrics
  559. Method: http.MethodGet,
  560. Path: "/core/metrics",
  561. Handler: core.MetricsHandler(serverCtx),
  562. },
  563. {
  564. // 查询P端服务列表
  565. Method: http.MethodGet,
  566. Path: "/core/participantList",
  567. Handler: core.ParticipantListHandler(serverCtx),
  568. },
  569. {
  570. // provide for adapter to pull task info from core
  571. Method: http.MethodGet,
  572. Path: "/core/pullTaskInfo",
  573. Handler: core.PullTaskInfoHandler(serverCtx),
  574. },
  575. {
  576. // provide for adapter to push notice info to core
  577. Method: http.MethodPost,
  578. Path: "/core/pushNotice",
  579. Handler: core.PushNoticeHandler(serverCtx),
  580. },
  581. {
  582. // provide for adapter to push resource info to core
  583. Method: http.MethodPost,
  584. Path: "/core/pushResourceInfo",
  585. Handler: core.PushResourceInfoHandler(serverCtx),
  586. },
  587. {
  588. // provide for adapter to push task info to core
  589. Method: http.MethodPost,
  590. Path: "/core/pushTaskInfo",
  591. Handler: core.PushTaskInfoHandler(serverCtx),
  592. },
  593. {
  594. // 设置控制面板配置信息
  595. Method: http.MethodPut,
  596. Path: "/core/resourcePanelConfigHandler",
  597. Handler: core.PutResourcePanelConfigHandler(serverCtx),
  598. },
  599. {
  600. // yaml提交任务
  601. Method: http.MethodPost,
  602. Path: "/core/scheduleTaskByYaml",
  603. Handler: core.ScheduleTaskByYamlHandler(serverCtx),
  604. },
  605. {
  606. // Synchronize Cluster Load Information
  607. Method: http.MethodPost,
  608. Path: "/core/syncClusterLoad",
  609. Handler: core.SyncClusterLoadHandler(serverCtx),
  610. },
  611. {
  612. // Statistical task status
  613. Method: http.MethodGet,
  614. Path: "/core/task/countTaskStatus",
  615. Handler: core.CountTaskStatusHandler(serverCtx),
  616. },
  617. {
  618. // task details
  619. Method: http.MethodGet,
  620. Path: "/core/task/details",
  621. Handler: core.TaskDetailsHandler(serverCtx),
  622. },
  623. {
  624. // paging queries the task list
  625. Method: http.MethodGet,
  626. Path: "/core/task/list",
  627. Handler: core.PageListTaskHandler(serverCtx),
  628. },
  629. {
  630. // paging queries the task list
  631. Method: http.MethodGet,
  632. Path: "/core/task/screen",
  633. Handler: core.ScreenPageTaskHandler(serverCtx),
  634. },
  635. {
  636. // 查询任务列表
  637. Method: http.MethodGet,
  638. Path: "/core/taskList",
  639. Handler: core.TaskListHandler(serverCtx),
  640. },
  641. },
  642. rest.WithPrefix("/pcm/v1"),
  643. )
  644. server.AddRoutes(
  645. []rest.Route{
  646. {
  647. Method: http.MethodPost,
  648. Path: "/dict",
  649. Handler: dictionary.AddDictHandler(serverCtx),
  650. },
  651. {
  652. Method: http.MethodPut,
  653. Path: "/dict",
  654. Handler: dictionary.EditDictHandler(serverCtx),
  655. },
  656. {
  657. Method: http.MethodGet,
  658. Path: "/dict/:id",
  659. Handler: dictionary.GetDictHandler(serverCtx),
  660. },
  661. {
  662. Method: http.MethodDelete,
  663. Path: "/dict/:id",
  664. Handler: dictionary.DeleteDictHandler(serverCtx),
  665. },
  666. {
  667. Method: http.MethodPost,
  668. Path: "/dictItem",
  669. Handler: dictionary.AddDictItemHandler(serverCtx),
  670. },
  671. {
  672. Method: http.MethodPut,
  673. Path: "/dictItem",
  674. Handler: dictionary.EditDictItemHandler(serverCtx),
  675. },
  676. {
  677. Method: http.MethodGet,
  678. Path: "/dictItem/:id",
  679. Handler: dictionary.GetDictItemHandler(serverCtx),
  680. },
  681. {
  682. Method: http.MethodDelete,
  683. Path: "/dictItem/:id",
  684. Handler: dictionary.DeleteDictItemHandler(serverCtx),
  685. },
  686. {
  687. Method: http.MethodGet,
  688. Path: "/dictItem/code/:dictCode",
  689. Handler: dictionary.ListDictItemByCodeHandler(serverCtx),
  690. },
  691. {
  692. Method: http.MethodGet,
  693. Path: "/dictItems",
  694. Handler: dictionary.ListDictItemHandler(serverCtx),
  695. },
  696. {
  697. Method: http.MethodGet,
  698. Path: "/dicts",
  699. Handler: dictionary.ListDictHandler(serverCtx),
  700. },
  701. },
  702. rest.WithPrefix("/pcm/v1"),
  703. )
  704. server.AddRoutes(
  705. []rest.Route{
  706. {
  707. // 查询超算应用中心列表
  708. Method: http.MethodGet,
  709. Path: "/hpc/ListInstanceCenter",
  710. Handler: hpc.ListInstanceCenterHandler(serverCtx),
  711. },
  712. {
  713. // 超算适配器列表
  714. Method: http.MethodGet,
  715. Path: "/hpc/adapterSummary",
  716. Handler: hpc.AdapterSummaryHandler(serverCtx),
  717. },
  718. {
  719. // 删除超算任务
  720. Method: http.MethodDelete,
  721. Path: "/hpc/cancelJob",
  722. Handler: hpc.CancelJobHandler(serverCtx),
  723. },
  724. {
  725. // 提交超算任务
  726. Method: http.MethodPost,
  727. Path: "/hpc/commitHpcTask",
  728. Handler: hpc.CommitHpcTaskHandler(serverCtx),
  729. },
  730. {
  731. // 查询超算应用支持的集群
  732. Method: http.MethodGet,
  733. Path: "/hpc/getHpcAppCluster",
  734. Handler: hpc.GetHpcAppClusterHandler(serverCtx),
  735. },
  736. {
  737. // 超算查询任务列表
  738. Method: http.MethodGet,
  739. Path: "/hpc/job",
  740. Handler: hpc.JobHandler(serverCtx),
  741. },
  742. {
  743. // 查看job状态
  744. Method: http.MethodGet,
  745. Path: "/hpc/jobInfo",
  746. Handler: hpc.JobInfoHandler(serverCtx),
  747. },
  748. {
  749. // 超算任务日志
  750. Method: http.MethodGet,
  751. Path: "/hpc/jobLogs/:taskId",
  752. Handler: hpc.GetHpcTaskLogHandler(serverCtx),
  753. },
  754. {
  755. // 超算总览
  756. Method: http.MethodGet,
  757. Path: "/hpc/overview",
  758. Handler: hpc.OverViewHandler(serverCtx),
  759. },
  760. {
  761. // 超算查询资产列表
  762. Method: http.MethodGet,
  763. Path: "/hpc/queueAssets",
  764. Handler: hpc.QueueAssetsHandler(serverCtx),
  765. },
  766. {
  767. // 超算资源总览
  768. Method: http.MethodGet,
  769. Path: "/hpc/resource",
  770. Handler: hpc.ResourceHandler(serverCtx),
  771. },
  772. },
  773. rest.WithPrefix("/pcm/v1"),
  774. )
  775. server.AddRoutes(
  776. []rest.Route{
  777. {
  778. Method: http.MethodPost,
  779. Path: "/inference/createDeployTask",
  780. Handler: inference.CreateDeployTaskHandler(serverCtx),
  781. },
  782. {
  783. Method: http.MethodPost,
  784. Path: "/inference/createTask",
  785. Handler: inference.CreateInferenceTaskHandler(serverCtx),
  786. },
  787. {
  788. Method: http.MethodGet,
  789. Path: "/inference/deployInstanceList",
  790. Handler: inference.DeployInstanceListHandler(serverCtx),
  791. },
  792. {
  793. Method: http.MethodGet,
  794. Path: "/inference/deployInstanceStat",
  795. Handler: inference.DeployInstanceStatHandler(serverCtx),
  796. },
  797. {
  798. Method: http.MethodGet,
  799. Path: "/inference/getAdaptersByModel",
  800. Handler: inference.GetAdaptersByModelHandler(serverCtx),
  801. },
  802. {
  803. Method: http.MethodGet,
  804. Path: "/inference/getDeployInstance",
  805. Handler: inference.GetDeployInstanceHandler(serverCtx),
  806. },
  807. {
  808. Method: http.MethodGet,
  809. Path: "/inference/getDeployTasksByType",
  810. Handler: inference.GetDeployTasksByTypeHandler(serverCtx),
  811. },
  812. {
  813. Method: http.MethodGet,
  814. Path: "/inference/getRunningInstanceById",
  815. Handler: inference.GetRunningInstanceByIdHandler(serverCtx),
  816. },
  817. {
  818. Method: http.MethodPost,
  819. Path: "/inference/images",
  820. Handler: inference.ImageInferenceHandler(serverCtx),
  821. },
  822. {
  823. Method: http.MethodGet,
  824. Path: "/inference/instanceCenter",
  825. Handler: inference.InstanceCenterHandler(serverCtx),
  826. },
  827. {
  828. Method: http.MethodGet,
  829. Path: "/inference/modelNames",
  830. Handler: inference.ModelNamesByTypeHandler(serverCtx),
  831. },
  832. {
  833. Method: http.MethodGet,
  834. Path: "/inference/modelTypes",
  835. Handler: inference.ModelTypesHandler(serverCtx),
  836. },
  837. {
  838. Method: http.MethodPost,
  839. Path: "/inference/startAll",
  840. Handler: inference.StartAllByDeployTaskIdHandler(serverCtx),
  841. },
  842. {
  843. Method: http.MethodPost,
  844. Path: "/inference/startDeployInstance",
  845. Handler: inference.StartDeployInstanceListHandler(serverCtx),
  846. },
  847. {
  848. Method: http.MethodPost,
  849. Path: "/inference/stopAll",
  850. Handler: inference.StopAllByDeployTaskIdHandler(serverCtx),
  851. },
  852. {
  853. Method: http.MethodPost,
  854. Path: "/inference/stopDeployInstance",
  855. Handler: inference.StopDeployInstanceHandler(serverCtx),
  856. },
  857. {
  858. Method: http.MethodGet,
  859. Path: "/inference/taskDetail",
  860. Handler: inference.InferenceTaskDetailHandler(serverCtx),
  861. },
  862. {
  863. Method: http.MethodGet,
  864. Path: "/inference/taskStat",
  865. Handler: inference.InferenceTaskStatHandler(serverCtx),
  866. },
  867. {
  868. Method: http.MethodPost,
  869. Path: "/inference/text",
  870. Handler: inference.TextToTextInferenceHandler(serverCtx),
  871. },
  872. },
  873. rest.WithPrefix("/pcm/v1"),
  874. )
  875. server.AddRoutes(
  876. []rest.Route{
  877. {
  878. Method: http.MethodGet,
  879. Path: "/monitoring/adapter/info",
  880. Handler: monitoring.AdapterInfoHandler(serverCtx),
  881. },
  882. {
  883. // alert list
  884. Method: http.MethodGet,
  885. Path: "/monitoring/alert/list",
  886. Handler: monitoring.AlertListHandler(serverCtx),
  887. },
  888. {
  889. Method: http.MethodPost,
  890. Path: "/monitoring/alert/rule",
  891. Handler: monitoring.CreateAlertRuleHandler(serverCtx),
  892. },
  893. {
  894. // alert rules
  895. Method: http.MethodGet,
  896. Path: "/monitoring/alert/rule",
  897. Handler: monitoring.AlertRulesHandler(serverCtx),
  898. },
  899. {
  900. Method: http.MethodDelete,
  901. Path: "/monitoring/alert/rule",
  902. Handler: monitoring.DeleteAlertRuleHandler(serverCtx),
  903. },
  904. {
  905. // cluster resource load
  906. Method: http.MethodGet,
  907. Path: "/monitoring/cluster/load",
  908. Handler: monitoring.ClustersLoadHandler(serverCtx),
  909. },
  910. {
  911. // node resource load
  912. Method: http.MethodGet,
  913. Path: "/monitoring/node/top",
  914. Handler: monitoring.NodesLoadTopHandler(serverCtx),
  915. },
  916. {
  917. Method: http.MethodGet,
  918. Path: "/monitoring/schedule/situation",
  919. Handler: monitoring.ScheduleSituationHandler(serverCtx),
  920. },
  921. {
  922. // Synchronize Cluster alert Information
  923. Method: http.MethodPost,
  924. Path: "/monitoring/syncClusterAlert",
  925. Handler: monitoring.SyncClusterAlertHandler(serverCtx),
  926. },
  927. {
  928. Method: http.MethodGet,
  929. Path: "/monitoring/task/num",
  930. Handler: monitoring.TaskNumHandler(serverCtx),
  931. },
  932. },
  933. rest.WithPrefix("/pcm/v1"),
  934. )
  935. server.AddRoutes(
  936. []rest.Route{
  937. {
  938. Method: http.MethodGet,
  939. Path: "/schedule/ai/getAlgorithms/:adapterId/:resourceType/:taskType/:dataset",
  940. Handler: schedule.ScheduleGetAlgorithmsHandler(serverCtx),
  941. },
  942. {
  943. Method: http.MethodGet,
  944. Path: "/schedule/ai/getDatasets/:adapterId",
  945. Handler: schedule.ScheduleGetDatasetsHandler(serverCtx),
  946. },
  947. {
  948. Method: http.MethodGet,
  949. Path: "/schedule/ai/getJobLog/:adapterId/:clusterId/:taskId/:instanceNum",
  950. Handler: schedule.ScheduleGetAiJobLogLogHandler(serverCtx),
  951. },
  952. {
  953. Method: http.MethodGet,
  954. Path: "/schedule/ai/getResourceTypes",
  955. Handler: schedule.ScheduleGetAiResourceTypesHandler(serverCtx),
  956. },
  957. {
  958. Method: http.MethodGet,
  959. Path: "/schedule/ai/getStrategies",
  960. Handler: schedule.ScheduleGetStrategyHandler(serverCtx),
  961. },
  962. {
  963. Method: http.MethodGet,
  964. Path: "/schedule/ai/getTaskTypes",
  965. Handler: schedule.ScheduleGetAiTaskTypesHandler(serverCtx),
  966. },
  967. {
  968. Method: http.MethodPost,
  969. Path: "/schedule/cancelTask",
  970. Handler: schedule.ScheduleCancelTaskHandler(serverCtx),
  971. },
  972. {
  973. Method: http.MethodPost,
  974. Path: "/schedule/createTask",
  975. Handler: schedule.ScheduleCreateTaskHandler(serverCtx),
  976. },
  977. {
  978. Method: http.MethodGet,
  979. Path: "/schedule/downloadAlgorithmCode",
  980. Handler: schedule.DownloadAlgothmCodeHandler(serverCtx),
  981. },
  982. {
  983. Method: http.MethodGet,
  984. Path: "/schedule/getClusterBalanceById/:adapterId/:clusterId",
  985. Handler: schedule.GetClusterBalanceByIdHandler(serverCtx),
  986. },
  987. {
  988. Method: http.MethodGet,
  989. Path: "/schedule/getComputeCardsByCluster/:adapterId/:clusterId",
  990. Handler: schedule.GetComputeCardsByClusterHandler(serverCtx),
  991. },
  992. {
  993. Method: http.MethodPost,
  994. Path: "/schedule/getOverview",
  995. Handler: schedule.ScheduleGetOverviewHandler(serverCtx),
  996. },
  997. {
  998. Method: http.MethodPost,
  999. Path: "/schedule/queryResources",
  1000. Handler: schedule.QueryResourcesHandler(serverCtx),
  1001. },
  1002. {
  1003. Method: http.MethodPost,
  1004. Path: "/schedule/runTask",
  1005. Handler: schedule.ScheduleRunTaskHandler(serverCtx),
  1006. },
  1007. {
  1008. Method: http.MethodPost,
  1009. Path: "/schedule/submit",
  1010. Handler: schedule.ScheduleSubmitHandler(serverCtx),
  1011. },
  1012. {
  1013. Method: http.MethodPost,
  1014. Path: "/schedule/uploadAlgorithmCode",
  1015. Handler: schedule.UploadAlgothmCodeHandler(serverCtx),
  1016. },
  1017. },
  1018. rest.WithPrefix("/pcm/v1"),
  1019. )
  1020. server.AddRoutes(
  1021. []rest.Route{
  1022. {
  1023. // 日常算力查询
  1024. Method: http.MethodGet,
  1025. Path: "/storage/dailyPowerScreen",
  1026. Handler: storage.DailyPowerScreenHandler(serverCtx),
  1027. },
  1028. {
  1029. // 算力中心算力情况
  1030. Method: http.MethodGet,
  1031. Path: "/storage/perCenterComputerPowers",
  1032. Handler: storage.PerCenterComputerPowersHandler(serverCtx),
  1033. },
  1034. },
  1035. rest.WithPrefix("/pcm/v1"),
  1036. )
  1037. server.AddRoutes(
  1038. []rest.Route{
  1039. {
  1040. Method: http.MethodDelete,
  1041. Path: "/storelink/deleteImage",
  1042. Handler: storelink.DeleteLinkImageHandler(serverCtx),
  1043. },
  1044. {
  1045. Method: http.MethodDelete,
  1046. Path: "/storelink/deleteTask",
  1047. Handler: storelink.DeleteLinkTaskHandler(serverCtx),
  1048. },
  1049. {
  1050. Method: http.MethodGet,
  1051. Path: "/storelink/getImageList",
  1052. Handler: storelink.GetLinkImageListHandler(serverCtx),
  1053. },
  1054. {
  1055. Method: http.MethodGet,
  1056. Path: "/storelink/getParticipants",
  1057. Handler: storelink.GetParticipantsHandler(serverCtx),
  1058. },
  1059. {
  1060. Method: http.MethodGet,
  1061. Path: "/storelink/getResourceSpecs",
  1062. Handler: storelink.GetAISpecsHandler(serverCtx),
  1063. },
  1064. {
  1065. Method: http.MethodGet,
  1066. Path: "/storelink/getTask",
  1067. Handler: storelink.GetLinkTaskHandler(serverCtx),
  1068. },
  1069. {
  1070. Method: http.MethodPost,
  1071. Path: "/storelink/submitTask",
  1072. Handler: storelink.SubmitLinkTaskHandler(serverCtx),
  1073. },
  1074. {
  1075. Method: http.MethodPost,
  1076. Path: "/storelink/uploadImage",
  1077. Handler: storelink.UploadLinkImageHandler(serverCtx),
  1078. },
  1079. },
  1080. rest.WithPrefix("/pcm/v1"),
  1081. )
  1082. server.AddRoutes(
  1083. []rest.Route{
  1084. {
  1085. // 将安全组添加到服务器
  1086. Method: http.MethodPost,
  1087. Path: "/vm/addSecurityGroupToServer",
  1088. Handler: vm.AddSecurityGroupToServerHandler(serverCtx),
  1089. },
  1090. {
  1091. // 批量创建网络
  1092. Method: http.MethodPost,
  1093. Path: "/vm/bulkCreateNetworks",
  1094. Handler: vm.BulkCreateNetworksHandler(serverCtx),
  1095. },
  1096. {
  1097. // 设置密码
  1098. Method: http.MethodPost,
  1099. Path: "/vm/changeAdministrativePassword",
  1100. Handler: vm.ChangeAdministrativePasswordHandler(serverCtx),
  1101. },
  1102. {
  1103. // 创建防火墙
  1104. Method: http.MethodPost,
  1105. Path: "/vm/createFirewallGroup",
  1106. Handler: vm.CreateFirewallGroupHandler(serverCtx),
  1107. },
  1108. {
  1109. // 创建防火墙策略
  1110. Method: http.MethodPost,
  1111. Path: "/vm/createFirewallPolicy",
  1112. Handler: vm.CreateFirewallPolicyHandler(serverCtx),
  1113. },
  1114. {
  1115. // 创建防火墙策略
  1116. Method: http.MethodPost,
  1117. Path: "/vm/createFirewallRule",
  1118. Handler: vm.CreateFirewallRuleHandler(serverCtx),
  1119. },
  1120. {
  1121. // 创建规格
  1122. Method: http.MethodPost,
  1123. Path: "/vm/createFlavor",
  1124. Handler: vm.CreateFlavorHandler(serverCtx),
  1125. },
  1126. {
  1127. // 创建浮动ip
  1128. Method: http.MethodPost,
  1129. Path: "/vm/createFloatingIP",
  1130. Handler: vm.CreateFloatingIPHandler(serverCtx),
  1131. },
  1132. {
  1133. // 创建镜像
  1134. Method: http.MethodPost,
  1135. Path: "/vm/createImage",
  1136. Handler: vm.CreateImageHandler(serverCtx),
  1137. },
  1138. {
  1139. // 跨域创建虚拟机
  1140. Method: http.MethodPost,
  1141. Path: "/vm/createMulServer",
  1142. Handler: vm.CreateMulServerHandler(serverCtx),
  1143. },
  1144. {
  1145. // 创建网络
  1146. Method: http.MethodPost,
  1147. Path: "/vm/createNetwork",
  1148. Handler: vm.CreateNetworkHandler(serverCtx),
  1149. },
  1150. {
  1151. // 创建网段
  1152. Method: http.MethodPost,
  1153. Path: "/vm/createNetworkSegmentRange",
  1154. Handler: vm.CreateNetworkSegmentRangeHandler(serverCtx),
  1155. },
  1156. {
  1157. // 创建节点
  1158. Method: http.MethodPost,
  1159. Path: "/vm/createNode",
  1160. Handler: vm.CreateNodeHandler(serverCtx),
  1161. },
  1162. {
  1163. // 创建端口
  1164. Method: http.MethodPost,
  1165. Path: "/vm/createPort",
  1166. Handler: vm.CreatePortHandler(serverCtx),
  1167. },
  1168. {
  1169. // 创建路由
  1170. Method: http.MethodPost,
  1171. Path: "/vm/createRouter",
  1172. Handler: vm.CreateRouterHandler(serverCtx),
  1173. },
  1174. {
  1175. // 创建安全组
  1176. Method: http.MethodPost,
  1177. Path: "/vm/createSecurityGroup",
  1178. Handler: vm.CreateSecurityGroupHandler(serverCtx),
  1179. },
  1180. {
  1181. // 创建安全组规则
  1182. Method: http.MethodPost,
  1183. Path: "/vm/createSecurityGroupRule",
  1184. Handler: vm.CreateSecurityGroupRuleHandler(serverCtx),
  1185. },
  1186. {
  1187. // 创建虚拟机
  1188. Method: http.MethodPost,
  1189. Path: "/vm/createServer",
  1190. Handler: vm.CreateServerHandler(serverCtx),
  1191. },
  1192. {
  1193. // 创建子网
  1194. Method: http.MethodPost,
  1195. Path: "/vm/createSubnet",
  1196. Handler: vm.CreateSubnetHandler(serverCtx),
  1197. },
  1198. {
  1199. // 创建卷
  1200. Method: http.MethodPost,
  1201. Path: "/vm/createVolume",
  1202. Handler: vm.CreateVolumeHandler(serverCtx),
  1203. },
  1204. {
  1205. // 创建卷类型
  1206. Method: http.MethodPost,
  1207. Path: "/vm/createVolumeTypes",
  1208. Handler: vm.CreateVolumeTypesHandler(serverCtx),
  1209. },
  1210. {
  1211. // 删除防火墙
  1212. Method: http.MethodDelete,
  1213. Path: "/vm/deleteFirewallGroup",
  1214. Handler: vm.DeleteFirewallGroupHandler(serverCtx),
  1215. },
  1216. {
  1217. // 删除防火墙策略
  1218. Method: http.MethodDelete,
  1219. Path: "/vm/deleteFirewallPolicy",
  1220. Handler: vm.DeleteFirewallPolicyHandler(serverCtx),
  1221. },
  1222. {
  1223. // 删除防火墙策略
  1224. Method: http.MethodDelete,
  1225. Path: "/vm/deleteFirewallRule",
  1226. Handler: vm.DeleteFirewallRuleHandler(serverCtx),
  1227. },
  1228. {
  1229. // 创建规格
  1230. Method: http.MethodPost,
  1231. Path: "/vm/deleteFlavor",
  1232. Handler: vm.DeleteFlavorHandler(serverCtx),
  1233. },
  1234. {
  1235. // 删除浮动ip
  1236. Method: http.MethodDelete,
  1237. Path: "/vm/deleteFloatingIP",
  1238. Handler: vm.DeleteFloatingIPHandler(serverCtx),
  1239. },
  1240. {
  1241. // 删除镜像
  1242. Method: http.MethodDelete,
  1243. Path: "/vm/deleteImage",
  1244. Handler: vm.DeleteImageHandler(serverCtx),
  1245. },
  1246. {
  1247. // 删除网络
  1248. Method: http.MethodDelete,
  1249. Path: "/vm/deleteNetwork",
  1250. Handler: vm.DeleteNetworkHandler(serverCtx),
  1251. },
  1252. {
  1253. // 删除网段
  1254. Method: http.MethodDelete,
  1255. Path: "/vm/deleteNetworkSegmentRanges",
  1256. Handler: vm.DeleteNetworkSegmentRangesHandler(serverCtx),
  1257. },
  1258. {
  1259. // 删除节点
  1260. Method: http.MethodDelete,
  1261. Path: "/vm/deleteNode",
  1262. Handler: vm.DeleteNodeHandler(serverCtx),
  1263. },
  1264. {
  1265. // 删除端口
  1266. Method: http.MethodDelete,
  1267. Path: "/vm/deletePort",
  1268. Handler: vm.DeletePortHandler(serverCtx),
  1269. },
  1270. {
  1271. // 删除路由
  1272. Method: http.MethodDelete,
  1273. Path: "/vm/deleteRouter",
  1274. Handler: vm.DeleteRouterHandler(serverCtx),
  1275. },
  1276. {
  1277. // 删除安全组
  1278. Method: http.MethodDelete,
  1279. Path: "/vm/deleteSecurityGroup",
  1280. Handler: vm.DeleteSecurityGroupHandler(serverCtx),
  1281. },
  1282. {
  1283. // 删除安全组规则
  1284. Method: http.MethodDelete,
  1285. Path: "/vm/deleteSecurityGroupRule",
  1286. Handler: vm.DeleteSecurityGroupRuleHandler(serverCtx),
  1287. },
  1288. {
  1289. // 删除虚拟机
  1290. Method: http.MethodDelete,
  1291. Path: "/vm/deleteServer",
  1292. Handler: vm.DeleteServerHandler(serverCtx),
  1293. },
  1294. {
  1295. // 删除子网
  1296. Method: http.MethodDelete,
  1297. Path: "/vm/deleteSubnet",
  1298. Handler: vm.DeleteSubnetHandler(serverCtx),
  1299. },
  1300. {
  1301. // 删除卷
  1302. Method: http.MethodDelete,
  1303. Path: "/vm/deleteVolume",
  1304. Handler: vm.DeleteVolumeHandler(serverCtx),
  1305. },
  1306. {
  1307. // 删除卷类型
  1308. Method: http.MethodDelete,
  1309. Path: "/vm/deleteVolumeType",
  1310. Handler: vm.DeleteVolumeTypeHandler(serverCtx),
  1311. },
  1312. {
  1313. // openstack计算中心概览
  1314. Method: http.MethodGet,
  1315. Path: "/vm/getComputeLimits",
  1316. Handler: vm.GetComputeLimitsHandler(serverCtx),
  1317. },
  1318. {
  1319. // 查询镜像数量
  1320. Method: http.MethodGet,
  1321. Path: "/vm/getImageNum",
  1322. Handler: vm.GetImageNumHandler(serverCtx),
  1323. },
  1324. {
  1325. // 查询网络数量
  1326. Method: http.MethodGet,
  1327. Path: "/vm/getNetworkNum",
  1328. Handler: vm.GetNetworkNumHandler(serverCtx),
  1329. },
  1330. {
  1331. // 查询虚拟机概览数据
  1332. Method: http.MethodGet,
  1333. Path: "/vm/getOpenstackOverview",
  1334. Handler: vm.GetOpenstackOverviewHandler(serverCtx),
  1335. },
  1336. {
  1337. // 根据ID查询虚拟机详情
  1338. Method: http.MethodGet,
  1339. Path: "/vm/getServersDetailedById",
  1340. Handler: vm.GetServersDetailedByIdHandler(serverCtx),
  1341. },
  1342. {
  1343. // 根据ID获取卷详情
  1344. Method: http.MethodGet,
  1345. Path: "/vm/getVolumeDetailedById",
  1346. Handler: vm.GetVolumeDetailedByIdHandler(serverCtx),
  1347. },
  1348. {
  1349. // 查询卷列表
  1350. Method: http.MethodGet,
  1351. Path: "/vm/getVolumeLimits",
  1352. Handler: vm.GetVolumeLimitsHandler(serverCtx),
  1353. },
  1354. {
  1355. // 查询防火墙列表
  1356. Method: http.MethodGet,
  1357. Path: "/vm/listFirewallGroups",
  1358. Handler: vm.ListFirewallGroupsHandler(serverCtx),
  1359. },
  1360. {
  1361. // 查询防火墙策略列表
  1362. Method: http.MethodGet,
  1363. Path: "/vm/listFirewallPolicies",
  1364. Handler: vm.ListFirewallPoliciesHandler(serverCtx),
  1365. },
  1366. {
  1367. // 查询防火墙策略列表
  1368. Method: http.MethodGet,
  1369. Path: "/vm/listFirewallRules",
  1370. Handler: vm.ListFirewallRulesHandler(serverCtx),
  1371. },
  1372. {
  1373. // 查询规格详情列表
  1374. Method: http.MethodGet,
  1375. Path: "/vm/listFlavorsDetail",
  1376. Handler: vm.ListFlavorsDetailHandler(serverCtx),
  1377. },
  1378. {
  1379. // 查询浮动ip列表
  1380. Method: http.MethodGet,
  1381. Path: "/vm/listFloatingIPs",
  1382. Handler: vm.ListFloatingIPsHandler(serverCtx),
  1383. },
  1384. {
  1385. // 查询镜像列表
  1386. Method: http.MethodGet,
  1387. Path: "/vm/listImages",
  1388. Handler: vm.ListImagesHandler(serverCtx),
  1389. },
  1390. {
  1391. // 查询网络列表
  1392. Method: http.MethodGet,
  1393. Path: "/vm/listNetworkSegmentRanges",
  1394. Handler: vm.ListNetworkSegmentRangesRangeHandler(serverCtx),
  1395. },
  1396. {
  1397. // 查询网络列表
  1398. Method: http.MethodGet,
  1399. Path: "/vm/listNetworks",
  1400. Handler: vm.ListNetworksHandler(serverCtx),
  1401. },
  1402. {
  1403. // 查询节点列表
  1404. Method: http.MethodGet,
  1405. Path: "/vm/listNodes",
  1406. Handler: vm.ListNodesHandler(serverCtx),
  1407. },
  1408. {
  1409. // 查询端口列表
  1410. Method: http.MethodGet,
  1411. Path: "/vm/listPortsReq",
  1412. Handler: vm.ListPortsHandler(serverCtx),
  1413. },
  1414. {
  1415. // 查询路由列表
  1416. Method: http.MethodGet,
  1417. Path: "/vm/listRouters",
  1418. Handler: vm.ListRoutersHandler(serverCtx),
  1419. },
  1420. {
  1421. // 查询安全组规则列表
  1422. Method: http.MethodGet,
  1423. Path: "/vm/listSecurityGroupRules",
  1424. Handler: vm.ListSecurityGroupRulesHandler(serverCtx),
  1425. },
  1426. {
  1427. // 查询安全组列表
  1428. Method: http.MethodGet,
  1429. Path: "/vm/listSecurityGroups",
  1430. Handler: vm.ListSecurityGroupsHandler(serverCtx),
  1431. },
  1432. {
  1433. // 查询虚拟机列表
  1434. Method: http.MethodGet,
  1435. Path: "/vm/listServer",
  1436. Handler: vm.ListServerHandler(serverCtx),
  1437. },
  1438. {
  1439. // 查询虚拟机详情列表
  1440. Method: http.MethodGet,
  1441. Path: "/vm/listServersDetailed",
  1442. Handler: vm.ListServersDetailedHandler(serverCtx),
  1443. },
  1444. {
  1445. // 查询子网列表
  1446. Method: http.MethodGet,
  1447. Path: "/vm/listSubnets",
  1448. Handler: vm.ListSubnetsHandler(serverCtx),
  1449. },
  1450. {
  1451. // 查询规格类型列表
  1452. Method: http.MethodGet,
  1453. Path: "/vm/listVolumeTypes",
  1454. Handler: vm.ListVolumeTypesHandler(serverCtx),
  1455. },
  1456. {
  1457. // 查询卷列表
  1458. Method: http.MethodGet,
  1459. Path: "/vm/listVolumes",
  1460. Handler: vm.ListVolumesHandler(serverCtx),
  1461. },
  1462. {
  1463. // 查询卷详情列表
  1464. Method: http.MethodGet,
  1465. Path: "/vm/listVolumesDetail",
  1466. Handler: vm.ListVolumesDetailHandler(serverCtx),
  1467. },
  1468. {
  1469. // 迁移
  1470. Method: http.MethodPost,
  1471. Path: "/vm/migrateServer",
  1472. Handler: vm.MigrateServerHandler(serverCtx),
  1473. },
  1474. {
  1475. // 暂停虚拟机
  1476. Method: http.MethodPost,
  1477. Path: "/vm/pauseServer",
  1478. Handler: vm.PauseServerHandler(serverCtx),
  1479. },
  1480. {
  1481. // 重启虚拟机
  1482. Method: http.MethodPost,
  1483. Path: "/vm/rebootServer",
  1484. Handler: vm.RebootServerHandler(serverCtx),
  1485. },
  1486. {
  1487. // 从服务器中删除安全
  1488. Method: http.MethodPost,
  1489. Path: "/vm/removeSecurityGroup",
  1490. Handler: vm.RemoveSecurityGroupHandler(serverCtx),
  1491. },
  1492. {
  1493. // 救援
  1494. Method: http.MethodPost,
  1495. Path: "/vm/rescueServer",
  1496. Handler: vm.RescueServerHandler(serverCtx),
  1497. },
  1498. {
  1499. // 调整大小
  1500. Method: http.MethodPost,
  1501. Path: "/vm/resizeServer",
  1502. Handler: vm.ResizeServerHandler(serverCtx),
  1503. },
  1504. {
  1505. // 搁置
  1506. Method: http.MethodPost,
  1507. Path: "/vm/shelveServer",
  1508. Handler: vm.ShelveServerHandler(serverCtx),
  1509. },
  1510. {
  1511. // 查询防火墙详情
  1512. Method: http.MethodGet,
  1513. Path: "/vm/showFirewallGroupDetails",
  1514. Handler: vm.ShowFirewallGroupDetailsHandler(serverCtx),
  1515. },
  1516. {
  1517. // 查询防火墙策略详情
  1518. Method: http.MethodGet,
  1519. Path: "/vm/showFirewallPolicyDetails",
  1520. Handler: vm.ShowFirewallPolicyDetailsHandler(serverCtx),
  1521. },
  1522. {
  1523. // 查询防火墙策略详情
  1524. Method: http.MethodGet,
  1525. Path: "/vm/showFirewallRuleDetails",
  1526. Handler: vm.ShowFirewallRuleDetailsHandler(serverCtx),
  1527. },
  1528. {
  1529. // 查询浮动ip详情
  1530. Method: http.MethodGet,
  1531. Path: "/vm/showFloatingIPDetails",
  1532. Handler: vm.ShowFloatingIPDetailsHandler(serverCtx),
  1533. },
  1534. {
  1535. // 查询网络详情
  1536. Method: http.MethodGet,
  1537. Path: "/vm/showNetworkDetails",
  1538. Handler: vm.ShowNetworkDetailsHandler(serverCtx),
  1539. },
  1540. {
  1541. // 显示网段详情
  1542. Method: http.MethodGet,
  1543. Path: "/vm/showNetworkSegmentRangeDetails",
  1544. Handler: vm.ShowNetworkSegmentRangeDetailsHandler(serverCtx),
  1545. },
  1546. {
  1547. // 查询节点详情
  1548. Method: http.MethodGet,
  1549. Path: "/vm/showNodeDetails",
  1550. Handler: vm.ShowNodeDetailsHandler(serverCtx),
  1551. },
  1552. {
  1553. // 查询端口详情
  1554. Method: http.MethodGet,
  1555. Path: "/vm/showPortDetails",
  1556. Handler: vm.ShowPortDetailsHandler(serverCtx),
  1557. },
  1558. {
  1559. // 查询路由详情
  1560. Method: http.MethodGet,
  1561. Path: "/vm/showRouterDetails",
  1562. Handler: vm.ShowRouterDetailsHandler(serverCtx),
  1563. },
  1564. {
  1565. // 查询安全组详情
  1566. Method: http.MethodGet,
  1567. Path: "/vm/showSecurityGroup",
  1568. Handler: vm.ShowSecurityGroupHandler(serverCtx),
  1569. },
  1570. {
  1571. // 查询安全组规则详情
  1572. Method: http.MethodGet,
  1573. Path: "/vm/showSecurityGroupRule",
  1574. Handler: vm.ShowSecurityGroupRuleHandler(serverCtx),
  1575. },
  1576. {
  1577. // 启动虚拟机
  1578. Method: http.MethodPost,
  1579. Path: "/vm/startServer",
  1580. Handler: vm.StartServerHandler(serverCtx),
  1581. },
  1582. {
  1583. // 停止虚拟机
  1584. Method: http.MethodPost,
  1585. Path: "/vm/stopServer",
  1586. Handler: vm.StopServerHandler(serverCtx),
  1587. },
  1588. {
  1589. // 中止
  1590. Method: http.MethodPost,
  1591. Path: "/vm/suspendServer",
  1592. Handler: vm.SuspendServerHandler(serverCtx),
  1593. },
  1594. {
  1595. // 取消救援
  1596. Method: http.MethodPost,
  1597. Path: "/vm/unRescueServer",
  1598. Handler: vm.UnRescueHandler(serverCtx),
  1599. },
  1600. {
  1601. // 取消暂停虚拟机
  1602. Method: http.MethodPost,
  1603. Path: "/vm/unpauseServer",
  1604. Handler: vm.UnpauseServerHandler(serverCtx),
  1605. },
  1606. {
  1607. // 修改防火墙
  1608. Method: http.MethodPut,
  1609. Path: "/vm/updateFirewallGroup",
  1610. Handler: vm.UpdateFirewallGroupHandler(serverCtx),
  1611. },
  1612. {
  1613. // 修改浮动ip
  1614. Method: http.MethodPut,
  1615. Path: "/vm/updateFloatingIP",
  1616. Handler: vm.UpdateFloatingIPHandler(serverCtx),
  1617. },
  1618. {
  1619. // 更新网络
  1620. Method: http.MethodPut,
  1621. Path: "/vm/updateNetwork",
  1622. Handler: vm.UpdateNetworkHandler(serverCtx),
  1623. },
  1624. {
  1625. // 修改网段
  1626. Method: http.MethodPut,
  1627. Path: "/vm/updateNetworkSegmentRanges",
  1628. Handler: vm.UpdateNetworkSegmentRangesHandler(serverCtx),
  1629. },
  1630. {
  1631. // 修改端口
  1632. Method: http.MethodPut,
  1633. Path: "/vm/updatePort",
  1634. Handler: vm.UpdatePortHandler(serverCtx),
  1635. },
  1636. {
  1637. // 修改路由
  1638. Method: http.MethodPut,
  1639. Path: "/vm/updateRouter",
  1640. Handler: vm.UpdateRouterHandler(serverCtx),
  1641. },
  1642. {
  1643. // 修改安全组
  1644. Method: http.MethodPut,
  1645. Path: "/vm/updateSecurityGroup",
  1646. Handler: vm.UpdateSecurityGroupHandler(serverCtx),
  1647. },
  1648. {
  1649. // 更新虚拟机
  1650. Method: http.MethodPut,
  1651. Path: "/vm/updateServer",
  1652. Handler: vm.UpdateServerHandler(serverCtx),
  1653. },
  1654. {
  1655. // 修改子网
  1656. Method: http.MethodPut,
  1657. Path: "/vm/updateSubnet",
  1658. Handler: vm.UpdateSubnetHandler(serverCtx),
  1659. },
  1660. {
  1661. // 更新卷
  1662. Method: http.MethodPut,
  1663. Path: "/vm/updateVolume",
  1664. Handler: vm.UpdateVolumeHandler(serverCtx),
  1665. },
  1666. {
  1667. // 上传镜像
  1668. Method: http.MethodPut,
  1669. Path: "/vm/uploadImage",
  1670. Handler: vm.UploadImageHandler(serverCtx),
  1671. },
  1672. },
  1673. rest.WithPrefix("/pcm/v1"),
  1674. )
  1675. }

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.