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
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667
  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. // 数算集群注册
  333. Method: http.MethodPost,
  334. Path: "/cloud/registerCluster",
  335. Handler: cloud.RegisterClusterHandler(serverCtx),
  336. },
  337. {
  338. // Create cloud computing common tasks
  339. Method: http.MethodPost,
  340. Path: "/cloud/task/create",
  341. Handler: cloud.CommitGeneralTaskHandler(serverCtx),
  342. },
  343. {
  344. // Obtain cluster list information according to adapterId
  345. Method: http.MethodGet,
  346. Path: "/core/clusterList",
  347. Handler: cloud.GetClusterListHandler(serverCtx),
  348. },
  349. {
  350. // 云算任务列表
  351. Method: http.MethodGet,
  352. Path: "/task/list",
  353. Handler: cloud.CloudListHandler(serverCtx),
  354. },
  355. },
  356. rest.WithPrefix("/pcm/v1"),
  357. )
  358. server.AddRoutes(
  359. []rest.Route{
  360. {
  361. // 取消资源规格告警
  362. Method: http.MethodPut,
  363. Path: "/core/ai/resourceSpec/cancelAlarm",
  364. Handler: core.CancelResourceSpecAlarmHandler(serverCtx),
  365. },
  366. {
  367. // 与Api接口对比集群资源规格
  368. Method: http.MethodGet,
  369. Path: "/core/ai/resourceSpec/compare",
  370. Handler: core.CompareResourceSpecHandler(serverCtx),
  371. },
  372. {
  373. // 删除资源规格
  374. Method: http.MethodDelete,
  375. Path: "/core/ai/resourceSpec/delete/:id",
  376. Handler: core.DeleteResourceSpecHandler(serverCtx),
  377. },
  378. {
  379. // 获取指定资源规格详情
  380. Method: http.MethodGet,
  381. Path: "/core/ai/resourceSpec/detail",
  382. Handler: core.DetailResourceSpecHandler(serverCtx),
  383. },
  384. {
  385. // 编辑资源规格
  386. Method: http.MethodPut,
  387. Path: "/core/ai/resourceSpec/edit",
  388. Handler: core.EditResourceSpecHandler(serverCtx),
  389. },
  390. {
  391. // 同步指定资源规格
  392. Method: http.MethodPut,
  393. Path: "/core/ai/resourceSpec/sync",
  394. Handler: core.SyncResourceSpecHandler(serverCtx),
  395. },
  396. {
  397. // 获取节点资产
  398. Method: http.MethodGet,
  399. Path: "/core/assets",
  400. Handler: core.NodeAssetsHandler(serverCtx),
  401. },
  402. {
  403. // 异步提交智算任务
  404. Method: http.MethodPost,
  405. Path: "/core/asynCommitAiTask",
  406. Handler: core.AsynCommitAiTaskHandler(serverCtx),
  407. },
  408. {
  409. // Center Resources top3
  410. Method: http.MethodGet,
  411. Path: "/core/centerResources",
  412. Handler: core.CenterResourcesHandler(serverCtx),
  413. },
  414. {
  415. // 提交任务
  416. Method: http.MethodPost,
  417. Path: "/core/commitTask",
  418. Handler: core.CommitTaskHandler(serverCtx),
  419. },
  420. {
  421. // 提交虚拟机任务
  422. Method: http.MethodPost,
  423. Path: "/core/commitVmTask",
  424. Handler: core.CommitVmTaskHandler(serverCtx),
  425. },
  426. {
  427. // 删除任务
  428. Method: http.MethodDelete,
  429. Path: "/core/deleteTask/:id",
  430. Handler: core.DeleteTaskHandler(serverCtx),
  431. },
  432. {
  433. // 根据集群id获取集群信息
  434. Method: http.MethodGet,
  435. Path: "/core/getClusterById",
  436. Handler: core.GetClusterByIdHandler(serverCtx),
  437. },
  438. {
  439. // 获取算力统计信息
  440. Method: http.MethodGet,
  441. Path: "/core/getComputilityStatistics",
  442. Handler: core.GetComputilityStatisticsHandler(serverCtx),
  443. },
  444. {
  445. // 查询算力
  446. Method: http.MethodGet,
  447. Path: "/core/getComputingPower",
  448. Handler: core.GetComputingPowerHandler(serverCtx),
  449. },
  450. {
  451. // screen
  452. Method: http.MethodGet,
  453. Path: "/core/getDomainResource",
  454. Handler: core.GetDomainResourceHandler(serverCtx),
  455. },
  456. {
  457. // 查询通用信息
  458. Method: http.MethodGet,
  459. Path: "/core/getGeneralInfo",
  460. Handler: core.GetGeneralInfoHandler(serverCtx),
  461. },
  462. {
  463. // Get Public Flavor
  464. Method: http.MethodGet,
  465. Path: "/core/getPublicFlavor",
  466. Handler: core.GetPublicFlavorHandler(serverCtx),
  467. },
  468. {
  469. // Get Public Image
  470. Method: http.MethodGet,
  471. Path: "/core/getPublicImage",
  472. Handler: core.GetPublicImageHandler(serverCtx),
  473. },
  474. {
  475. // Get Public Network
  476. Method: http.MethodGet,
  477. Path: "/core/getPublicNetwork",
  478. Handler: core.GetPublicNetworkHandler(serverCtx),
  479. },
  480. {
  481. // 获取region
  482. Method: http.MethodGet,
  483. Path: "/core/getRegion",
  484. Handler: core.GetRegionHandler(serverCtx),
  485. },
  486. {
  487. // 查询控制面板配置信息
  488. Method: http.MethodGet,
  489. Path: "/core/getResourcePanelConfigHandler",
  490. Handler: core.GetResourcePanelConfigHandler(serverCtx),
  491. },
  492. {
  493. // screen
  494. Method: http.MethodGet,
  495. Path: "/core/getScreenChart",
  496. Handler: core.GetScreenChartHandler(serverCtx),
  497. },
  498. {
  499. // screen
  500. Method: http.MethodGet,
  501. Path: "/core/getScreenInfo",
  502. Handler: core.GetScreenInfoHandler(serverCtx),
  503. },
  504. {
  505. // Home Page Overview
  506. Method: http.MethodGet,
  507. Path: "/core/homeOverview",
  508. Handler: core.HomeOverviewHandler(serverCtx),
  509. },
  510. {
  511. // 任务概览
  512. Method: http.MethodGet,
  513. Path: "/core/jobTotal",
  514. Handler: core.JobTotalHandler(serverCtx),
  515. },
  516. {
  517. // 数据中心概览
  518. Method: http.MethodGet,
  519. Path: "/core/listCenter",
  520. Handler: core.ListCenterHandler(serverCtx),
  521. },
  522. {
  523. // 查询集群列表
  524. Method: http.MethodGet,
  525. Path: "/core/listCluster/:centerId",
  526. Handler: core.ListClusterHandler(serverCtx),
  527. },
  528. {
  529. // list notice
  530. Method: http.MethodGet,
  531. Path: "/core/listNotice",
  532. Handler: core.ListNoticeHandler(serverCtx),
  533. },
  534. {
  535. // 获取region列表
  536. Method: http.MethodGet,
  537. Path: "/core/listRegion",
  538. Handler: core.ListRegionHandler(serverCtx),
  539. },
  540. {
  541. // metrics
  542. Method: http.MethodGet,
  543. Path: "/core/metrics",
  544. Handler: core.MetricsHandler(serverCtx),
  545. },
  546. {
  547. // 查询P端服务列表
  548. Method: http.MethodGet,
  549. Path: "/core/participantList",
  550. Handler: core.ParticipantListHandler(serverCtx),
  551. },
  552. {
  553. // provide for adapter to pull task info from core
  554. Method: http.MethodGet,
  555. Path: "/core/pullTaskInfo",
  556. Handler: core.PullTaskInfoHandler(serverCtx),
  557. },
  558. {
  559. // provide for adapter to push notice info to core
  560. Method: http.MethodPost,
  561. Path: "/core/pushNotice",
  562. Handler: core.PushNoticeHandler(serverCtx),
  563. },
  564. {
  565. // provide for adapter to push resource info to core
  566. Method: http.MethodPost,
  567. Path: "/core/pushResourceInfo",
  568. Handler: core.PushResourceInfoHandler(serverCtx),
  569. },
  570. {
  571. // provide for adapter to push task info to core
  572. Method: http.MethodPost,
  573. Path: "/core/pushTaskInfo",
  574. Handler: core.PushTaskInfoHandler(serverCtx),
  575. },
  576. {
  577. // 设置控制面板配置信息
  578. Method: http.MethodPut,
  579. Path: "/core/resourcePanelConfigHandler",
  580. Handler: core.PutResourcePanelConfigHandler(serverCtx),
  581. },
  582. {
  583. // yaml提交任务
  584. Method: http.MethodPost,
  585. Path: "/core/scheduleTaskByYaml",
  586. Handler: core.ScheduleTaskByYamlHandler(serverCtx),
  587. },
  588. {
  589. // Synchronize Cluster Load Information
  590. Method: http.MethodPost,
  591. Path: "/core/syncClusterLoad",
  592. Handler: core.SyncClusterLoadHandler(serverCtx),
  593. },
  594. {
  595. // Statistical task status
  596. Method: http.MethodGet,
  597. Path: "/core/task/countTaskStatus",
  598. Handler: core.CountTaskStatusHandler(serverCtx),
  599. },
  600. {
  601. // task details
  602. Method: http.MethodGet,
  603. Path: "/core/task/details",
  604. Handler: core.TaskDetailsHandler(serverCtx),
  605. },
  606. {
  607. // paging queries the task list
  608. Method: http.MethodGet,
  609. Path: "/core/task/list",
  610. Handler: core.PageListTaskHandler(serverCtx),
  611. },
  612. {
  613. // paging queries the task list
  614. Method: http.MethodGet,
  615. Path: "/core/task/screen",
  616. Handler: core.ScreenPageTaskHandler(serverCtx),
  617. },
  618. {
  619. // 查询任务列表
  620. Method: http.MethodGet,
  621. Path: "/core/taskList",
  622. Handler: core.TaskListHandler(serverCtx),
  623. },
  624. },
  625. rest.WithPrefix("/pcm/v1"),
  626. )
  627. server.AddRoutes(
  628. []rest.Route{
  629. {
  630. Method: http.MethodPost,
  631. Path: "/dict",
  632. Handler: dictionary.AddDictHandler(serverCtx),
  633. },
  634. {
  635. Method: http.MethodPut,
  636. Path: "/dict",
  637. Handler: dictionary.EditDictHandler(serverCtx),
  638. },
  639. {
  640. Method: http.MethodGet,
  641. Path: "/dict/:id",
  642. Handler: dictionary.GetDictHandler(serverCtx),
  643. },
  644. {
  645. Method: http.MethodDelete,
  646. Path: "/dict/:id",
  647. Handler: dictionary.DeleteDictHandler(serverCtx),
  648. },
  649. {
  650. Method: http.MethodPost,
  651. Path: "/dictItem",
  652. Handler: dictionary.AddDictItemHandler(serverCtx),
  653. },
  654. {
  655. Method: http.MethodPut,
  656. Path: "/dictItem",
  657. Handler: dictionary.EditDictItemHandler(serverCtx),
  658. },
  659. {
  660. Method: http.MethodGet,
  661. Path: "/dictItem/:id",
  662. Handler: dictionary.GetDictItemHandler(serverCtx),
  663. },
  664. {
  665. Method: http.MethodDelete,
  666. Path: "/dictItem/:id",
  667. Handler: dictionary.DeleteDictItemHandler(serverCtx),
  668. },
  669. {
  670. Method: http.MethodGet,
  671. Path: "/dictItem/code/:dictCode",
  672. Handler: dictionary.ListDictItemByCodeHandler(serverCtx),
  673. },
  674. {
  675. Method: http.MethodGet,
  676. Path: "/dictItems",
  677. Handler: dictionary.ListDictItemHandler(serverCtx),
  678. },
  679. {
  680. Method: http.MethodGet,
  681. Path: "/dicts",
  682. Handler: dictionary.ListDictHandler(serverCtx),
  683. },
  684. },
  685. rest.WithPrefix("/pcm/v1"),
  686. )
  687. server.AddRoutes(
  688. []rest.Route{
  689. {
  690. // 查询超算应用中心列表
  691. Method: http.MethodGet,
  692. Path: "/hpc/ListInstanceCenter",
  693. Handler: hpc.ListInstanceCenterHandler(serverCtx),
  694. },
  695. {
  696. // 超算适配器列表
  697. Method: http.MethodGet,
  698. Path: "/hpc/adapterSummary",
  699. Handler: hpc.AdapterSummaryHandler(serverCtx),
  700. },
  701. {
  702. // 删除超算任务
  703. Method: http.MethodDelete,
  704. Path: "/hpc/cancelJob",
  705. Handler: hpc.CancelJobHandler(serverCtx),
  706. },
  707. {
  708. // 提交超算任务
  709. Method: http.MethodPost,
  710. Path: "/hpc/commitHpcTask",
  711. Handler: hpc.CommitHpcTaskHandler(serverCtx),
  712. },
  713. {
  714. // 超算查询任务列表
  715. Method: http.MethodGet,
  716. Path: "/hpc/job",
  717. Handler: hpc.JobHandler(serverCtx),
  718. },
  719. {
  720. // 查看job状态
  721. Method: http.MethodGet,
  722. Path: "/hpc/jobInfo",
  723. Handler: hpc.JobInfoHandler(serverCtx),
  724. },
  725. {
  726. // 超算任务日志
  727. Method: http.MethodGet,
  728. Path: "/hpc/jobLogs/:taskId",
  729. Handler: hpc.GetHpcTaskLogHandler(serverCtx),
  730. },
  731. {
  732. // 超算总览
  733. Method: http.MethodGet,
  734. Path: "/hpc/overview",
  735. Handler: hpc.OverViewHandler(serverCtx),
  736. },
  737. {
  738. // 超算查询资产列表
  739. Method: http.MethodGet,
  740. Path: "/hpc/queueAssets",
  741. Handler: hpc.QueueAssetsHandler(serverCtx),
  742. },
  743. {
  744. // 超算资源总览
  745. Method: http.MethodGet,
  746. Path: "/hpc/resource",
  747. Handler: hpc.ResourceHandler(serverCtx),
  748. },
  749. },
  750. rest.WithPrefix("/pcm/v1"),
  751. )
  752. server.AddRoutes(
  753. []rest.Route{
  754. {
  755. Method: http.MethodPost,
  756. Path: "/inference/createDeployTask",
  757. Handler: inference.CreateDeployTaskHandler(serverCtx),
  758. },
  759. {
  760. Method: http.MethodPost,
  761. Path: "/inference/createTask",
  762. Handler: inference.CreateInferenceTaskHandler(serverCtx),
  763. },
  764. {
  765. Method: http.MethodGet,
  766. Path: "/inference/deployInstanceList",
  767. Handler: inference.DeployInstanceListHandler(serverCtx),
  768. },
  769. {
  770. Method: http.MethodGet,
  771. Path: "/inference/deployInstanceStat",
  772. Handler: inference.DeployInstanceStatHandler(serverCtx),
  773. },
  774. {
  775. Method: http.MethodGet,
  776. Path: "/inference/getAdaptersByModel",
  777. Handler: inference.GetAdaptersByModelHandler(serverCtx),
  778. },
  779. {
  780. Method: http.MethodGet,
  781. Path: "/inference/getDeployInstance",
  782. Handler: inference.GetDeployInstanceHandler(serverCtx),
  783. },
  784. {
  785. Method: http.MethodGet,
  786. Path: "/inference/getDeployTasksByType",
  787. Handler: inference.GetDeployTasksByTypeHandler(serverCtx),
  788. },
  789. {
  790. Method: http.MethodGet,
  791. Path: "/inference/getRunningInstanceById",
  792. Handler: inference.GetRunningInstanceByIdHandler(serverCtx),
  793. },
  794. {
  795. Method: http.MethodPost,
  796. Path: "/inference/images",
  797. Handler: inference.ImageInferenceHandler(serverCtx),
  798. },
  799. {
  800. Method: http.MethodGet,
  801. Path: "/inference/instanceCenter",
  802. Handler: inference.InstanceCenterHandler(serverCtx),
  803. },
  804. {
  805. Method: http.MethodGet,
  806. Path: "/inference/modelNames",
  807. Handler: inference.ModelNamesByTypeHandler(serverCtx),
  808. },
  809. {
  810. Method: http.MethodGet,
  811. Path: "/inference/modelTypes",
  812. Handler: inference.ModelTypesHandler(serverCtx),
  813. },
  814. {
  815. Method: http.MethodPost,
  816. Path: "/inference/startAll",
  817. Handler: inference.StartAllByDeployTaskIdHandler(serverCtx),
  818. },
  819. {
  820. Method: http.MethodPost,
  821. Path: "/inference/startDeployInstance",
  822. Handler: inference.StartDeployInstanceListHandler(serverCtx),
  823. },
  824. {
  825. Method: http.MethodPost,
  826. Path: "/inference/stopAll",
  827. Handler: inference.StopAllByDeployTaskIdHandler(serverCtx),
  828. },
  829. {
  830. Method: http.MethodPost,
  831. Path: "/inference/stopDeployInstance",
  832. Handler: inference.StopDeployInstanceHandler(serverCtx),
  833. },
  834. {
  835. Method: http.MethodGet,
  836. Path: "/inference/taskDetail",
  837. Handler: inference.InferenceTaskDetailHandler(serverCtx),
  838. },
  839. {
  840. Method: http.MethodGet,
  841. Path: "/inference/taskStat",
  842. Handler: inference.InferenceTaskStatHandler(serverCtx),
  843. },
  844. {
  845. Method: http.MethodPost,
  846. Path: "/inference/text",
  847. Handler: inference.TextToTextInferenceHandler(serverCtx),
  848. },
  849. },
  850. rest.WithPrefix("/pcm/v1"),
  851. )
  852. server.AddRoutes(
  853. []rest.Route{
  854. {
  855. Method: http.MethodGet,
  856. Path: "/monitoring/adapter/info",
  857. Handler: monitoring.AdapterInfoHandler(serverCtx),
  858. },
  859. {
  860. // alert list
  861. Method: http.MethodGet,
  862. Path: "/monitoring/alert/list",
  863. Handler: monitoring.AlertListHandler(serverCtx),
  864. },
  865. {
  866. Method: http.MethodPost,
  867. Path: "/monitoring/alert/rule",
  868. Handler: monitoring.CreateAlertRuleHandler(serverCtx),
  869. },
  870. {
  871. // alert rules
  872. Method: http.MethodGet,
  873. Path: "/monitoring/alert/rule",
  874. Handler: monitoring.AlertRulesHandler(serverCtx),
  875. },
  876. {
  877. Method: http.MethodDelete,
  878. Path: "/monitoring/alert/rule",
  879. Handler: monitoring.DeleteAlertRuleHandler(serverCtx),
  880. },
  881. {
  882. // cluster resource load
  883. Method: http.MethodGet,
  884. Path: "/monitoring/cluster/load",
  885. Handler: monitoring.ClustersLoadHandler(serverCtx),
  886. },
  887. {
  888. // node resource load
  889. Method: http.MethodGet,
  890. Path: "/monitoring/node/top",
  891. Handler: monitoring.NodesLoadTopHandler(serverCtx),
  892. },
  893. {
  894. Method: http.MethodGet,
  895. Path: "/monitoring/schedule/situation",
  896. Handler: monitoring.ScheduleSituationHandler(serverCtx),
  897. },
  898. {
  899. // Synchronize Cluster alert Information
  900. Method: http.MethodPost,
  901. Path: "/monitoring/syncClusterAlert",
  902. Handler: monitoring.SyncClusterAlertHandler(serverCtx),
  903. },
  904. {
  905. Method: http.MethodGet,
  906. Path: "/monitoring/task/num",
  907. Handler: monitoring.TaskNumHandler(serverCtx),
  908. },
  909. },
  910. rest.WithPrefix("/pcm/v1"),
  911. )
  912. server.AddRoutes(
  913. []rest.Route{
  914. {
  915. Method: http.MethodGet,
  916. Path: "/schedule/ai/getAlgorithms/:adapterId/:resourceType/:taskType/:dataset",
  917. Handler: schedule.ScheduleGetAlgorithmsHandler(serverCtx),
  918. },
  919. {
  920. Method: http.MethodGet,
  921. Path: "/schedule/ai/getDatasets/:adapterId",
  922. Handler: schedule.ScheduleGetDatasetsHandler(serverCtx),
  923. },
  924. {
  925. Method: http.MethodGet,
  926. Path: "/schedule/ai/getJobLog/:adapterId/:clusterId/:taskId/:instanceNum",
  927. Handler: schedule.ScheduleGetAiJobLogLogHandler(serverCtx),
  928. },
  929. {
  930. Method: http.MethodGet,
  931. Path: "/schedule/ai/getResourceTypes",
  932. Handler: schedule.ScheduleGetAiResourceTypesHandler(serverCtx),
  933. },
  934. {
  935. Method: http.MethodGet,
  936. Path: "/schedule/ai/getStrategies",
  937. Handler: schedule.ScheduleGetStrategyHandler(serverCtx),
  938. },
  939. {
  940. Method: http.MethodGet,
  941. Path: "/schedule/ai/getTaskTypes",
  942. Handler: schedule.ScheduleGetAiTaskTypesHandler(serverCtx),
  943. },
  944. {
  945. Method: http.MethodPost,
  946. Path: "/schedule/cancelTask",
  947. Handler: schedule.ScheduleCancelTaskHandler(serverCtx),
  948. },
  949. {
  950. Method: http.MethodPost,
  951. Path: "/schedule/createTask",
  952. Handler: schedule.ScheduleCreateTaskHandler(serverCtx),
  953. },
  954. {
  955. Method: http.MethodGet,
  956. Path: "/schedule/downloadAlgorithmCode",
  957. Handler: schedule.DownloadAlgothmCodeHandler(serverCtx),
  958. },
  959. {
  960. Method: http.MethodGet,
  961. Path: "/schedule/getClusterBalanceById/:adapterId/:clusterId",
  962. Handler: schedule.GetClusterBalanceByIdHandler(serverCtx),
  963. },
  964. {
  965. Method: http.MethodGet,
  966. Path: "/schedule/getComputeCardsByCluster/:adapterId/:clusterId",
  967. Handler: schedule.GetComputeCardsByClusterHandler(serverCtx),
  968. },
  969. {
  970. Method: http.MethodPost,
  971. Path: "/schedule/getOverview",
  972. Handler: schedule.ScheduleGetOverviewHandler(serverCtx),
  973. },
  974. {
  975. Method: http.MethodPost,
  976. Path: "/schedule/queryResources",
  977. Handler: schedule.QueryResourcesHandler(serverCtx),
  978. },
  979. {
  980. Method: http.MethodPost,
  981. Path: "/schedule/runTask",
  982. Handler: schedule.ScheduleRunTaskHandler(serverCtx),
  983. },
  984. {
  985. Method: http.MethodPost,
  986. Path: "/schedule/submit",
  987. Handler: schedule.ScheduleSubmitHandler(serverCtx),
  988. },
  989. {
  990. Method: http.MethodPost,
  991. Path: "/schedule/uploadAlgorithmCode",
  992. Handler: schedule.UploadAlgothmCodeHandler(serverCtx),
  993. },
  994. },
  995. rest.WithPrefix("/pcm/v1"),
  996. )
  997. server.AddRoutes(
  998. []rest.Route{
  999. {
  1000. // 日常算力查询
  1001. Method: http.MethodGet,
  1002. Path: "/storage/dailyPowerScreen",
  1003. Handler: storage.DailyPowerScreenHandler(serverCtx),
  1004. },
  1005. {
  1006. // 算力中心算力情况
  1007. Method: http.MethodGet,
  1008. Path: "/storage/perCenterComputerPowers",
  1009. Handler: storage.PerCenterComputerPowersHandler(serverCtx),
  1010. },
  1011. },
  1012. rest.WithPrefix("/pcm/v1"),
  1013. )
  1014. server.AddRoutes(
  1015. []rest.Route{
  1016. {
  1017. Method: http.MethodDelete,
  1018. Path: "/storelink/deleteImage",
  1019. Handler: storelink.DeleteLinkImageHandler(serverCtx),
  1020. },
  1021. {
  1022. Method: http.MethodDelete,
  1023. Path: "/storelink/deleteTask",
  1024. Handler: storelink.DeleteLinkTaskHandler(serverCtx),
  1025. },
  1026. {
  1027. Method: http.MethodGet,
  1028. Path: "/storelink/getImageList",
  1029. Handler: storelink.GetLinkImageListHandler(serverCtx),
  1030. },
  1031. {
  1032. Method: http.MethodGet,
  1033. Path: "/storelink/getParticipants",
  1034. Handler: storelink.GetParticipantsHandler(serverCtx),
  1035. },
  1036. {
  1037. Method: http.MethodGet,
  1038. Path: "/storelink/getResourceSpecs",
  1039. Handler: storelink.GetAISpecsHandler(serverCtx),
  1040. },
  1041. {
  1042. Method: http.MethodGet,
  1043. Path: "/storelink/getTask",
  1044. Handler: storelink.GetLinkTaskHandler(serverCtx),
  1045. },
  1046. {
  1047. Method: http.MethodPost,
  1048. Path: "/storelink/submitTask",
  1049. Handler: storelink.SubmitLinkTaskHandler(serverCtx),
  1050. },
  1051. {
  1052. Method: http.MethodPost,
  1053. Path: "/storelink/uploadImage",
  1054. Handler: storelink.UploadLinkImageHandler(serverCtx),
  1055. },
  1056. },
  1057. rest.WithPrefix("/pcm/v1"),
  1058. )
  1059. server.AddRoutes(
  1060. []rest.Route{
  1061. {
  1062. // 将安全组添加到服务器
  1063. Method: http.MethodPost,
  1064. Path: "/vm/addSecurityGroupToServer",
  1065. Handler: vm.AddSecurityGroupToServerHandler(serverCtx),
  1066. },
  1067. {
  1068. // 批量创建网络
  1069. Method: http.MethodPost,
  1070. Path: "/vm/bulkCreateNetworks",
  1071. Handler: vm.BulkCreateNetworksHandler(serverCtx),
  1072. },
  1073. {
  1074. // 设置密码
  1075. Method: http.MethodPost,
  1076. Path: "/vm/changeAdministrativePassword",
  1077. Handler: vm.ChangeAdministrativePasswordHandler(serverCtx),
  1078. },
  1079. {
  1080. // 创建防火墙
  1081. Method: http.MethodPost,
  1082. Path: "/vm/createFirewallGroup",
  1083. Handler: vm.CreateFirewallGroupHandler(serverCtx),
  1084. },
  1085. {
  1086. // 创建防火墙策略
  1087. Method: http.MethodPost,
  1088. Path: "/vm/createFirewallPolicy",
  1089. Handler: vm.CreateFirewallPolicyHandler(serverCtx),
  1090. },
  1091. {
  1092. // 创建防火墙策略
  1093. Method: http.MethodPost,
  1094. Path: "/vm/createFirewallRule",
  1095. Handler: vm.CreateFirewallRuleHandler(serverCtx),
  1096. },
  1097. {
  1098. // 创建规格
  1099. Method: http.MethodPost,
  1100. Path: "/vm/createFlavor",
  1101. Handler: vm.CreateFlavorHandler(serverCtx),
  1102. },
  1103. {
  1104. // 创建浮动ip
  1105. Method: http.MethodPost,
  1106. Path: "/vm/createFloatingIP",
  1107. Handler: vm.CreateFloatingIPHandler(serverCtx),
  1108. },
  1109. {
  1110. // 创建镜像
  1111. Method: http.MethodPost,
  1112. Path: "/vm/createImage",
  1113. Handler: vm.CreateImageHandler(serverCtx),
  1114. },
  1115. {
  1116. // 跨域创建虚拟机
  1117. Method: http.MethodPost,
  1118. Path: "/vm/createMulServer",
  1119. Handler: vm.CreateMulServerHandler(serverCtx),
  1120. },
  1121. {
  1122. // 创建网络
  1123. Method: http.MethodPost,
  1124. Path: "/vm/createNetwork",
  1125. Handler: vm.CreateNetworkHandler(serverCtx),
  1126. },
  1127. {
  1128. // 创建网段
  1129. Method: http.MethodPost,
  1130. Path: "/vm/createNetworkSegmentRange",
  1131. Handler: vm.CreateNetworkSegmentRangeHandler(serverCtx),
  1132. },
  1133. {
  1134. // 创建节点
  1135. Method: http.MethodPost,
  1136. Path: "/vm/createNode",
  1137. Handler: vm.CreateNodeHandler(serverCtx),
  1138. },
  1139. {
  1140. // 创建端口
  1141. Method: http.MethodPost,
  1142. Path: "/vm/createPort",
  1143. Handler: vm.CreatePortHandler(serverCtx),
  1144. },
  1145. {
  1146. // 创建路由
  1147. Method: http.MethodPost,
  1148. Path: "/vm/createRouter",
  1149. Handler: vm.CreateRouterHandler(serverCtx),
  1150. },
  1151. {
  1152. // 创建安全组
  1153. Method: http.MethodPost,
  1154. Path: "/vm/createSecurityGroup",
  1155. Handler: vm.CreateSecurityGroupHandler(serverCtx),
  1156. },
  1157. {
  1158. // 创建安全组规则
  1159. Method: http.MethodPost,
  1160. Path: "/vm/createSecurityGroupRule",
  1161. Handler: vm.CreateSecurityGroupRuleHandler(serverCtx),
  1162. },
  1163. {
  1164. // 创建虚拟机
  1165. Method: http.MethodPost,
  1166. Path: "/vm/createServer",
  1167. Handler: vm.CreateServerHandler(serverCtx),
  1168. },
  1169. {
  1170. // 创建子网
  1171. Method: http.MethodPost,
  1172. Path: "/vm/createSubnet",
  1173. Handler: vm.CreateSubnetHandler(serverCtx),
  1174. },
  1175. {
  1176. // 创建卷
  1177. Method: http.MethodPost,
  1178. Path: "/vm/createVolume",
  1179. Handler: vm.CreateVolumeHandler(serverCtx),
  1180. },
  1181. {
  1182. // 创建卷类型
  1183. Method: http.MethodPost,
  1184. Path: "/vm/createVolumeTypes",
  1185. Handler: vm.CreateVolumeTypesHandler(serverCtx),
  1186. },
  1187. {
  1188. // 删除防火墙
  1189. Method: http.MethodDelete,
  1190. Path: "/vm/deleteFirewallGroup",
  1191. Handler: vm.DeleteFirewallGroupHandler(serverCtx),
  1192. },
  1193. {
  1194. // 删除防火墙策略
  1195. Method: http.MethodDelete,
  1196. Path: "/vm/deleteFirewallPolicy",
  1197. Handler: vm.DeleteFirewallPolicyHandler(serverCtx),
  1198. },
  1199. {
  1200. // 删除防火墙策略
  1201. Method: http.MethodDelete,
  1202. Path: "/vm/deleteFirewallRule",
  1203. Handler: vm.DeleteFirewallRuleHandler(serverCtx),
  1204. },
  1205. {
  1206. // 创建规格
  1207. Method: http.MethodPost,
  1208. Path: "/vm/deleteFlavor",
  1209. Handler: vm.DeleteFlavorHandler(serverCtx),
  1210. },
  1211. {
  1212. // 删除浮动ip
  1213. Method: http.MethodDelete,
  1214. Path: "/vm/deleteFloatingIP",
  1215. Handler: vm.DeleteFloatingIPHandler(serverCtx),
  1216. },
  1217. {
  1218. // 删除镜像
  1219. Method: http.MethodDelete,
  1220. Path: "/vm/deleteImage",
  1221. Handler: vm.DeleteImageHandler(serverCtx),
  1222. },
  1223. {
  1224. // 删除网络
  1225. Method: http.MethodDelete,
  1226. Path: "/vm/deleteNetwork",
  1227. Handler: vm.DeleteNetworkHandler(serverCtx),
  1228. },
  1229. {
  1230. // 删除网段
  1231. Method: http.MethodDelete,
  1232. Path: "/vm/deleteNetworkSegmentRanges",
  1233. Handler: vm.DeleteNetworkSegmentRangesHandler(serverCtx),
  1234. },
  1235. {
  1236. // 删除节点
  1237. Method: http.MethodDelete,
  1238. Path: "/vm/deleteNode",
  1239. Handler: vm.DeleteNodeHandler(serverCtx),
  1240. },
  1241. {
  1242. // 删除端口
  1243. Method: http.MethodDelete,
  1244. Path: "/vm/deletePort",
  1245. Handler: vm.DeletePortHandler(serverCtx),
  1246. },
  1247. {
  1248. // 删除路由
  1249. Method: http.MethodDelete,
  1250. Path: "/vm/deleteRouter",
  1251. Handler: vm.DeleteRouterHandler(serverCtx),
  1252. },
  1253. {
  1254. // 删除安全组
  1255. Method: http.MethodDelete,
  1256. Path: "/vm/deleteSecurityGroup",
  1257. Handler: vm.DeleteSecurityGroupHandler(serverCtx),
  1258. },
  1259. {
  1260. // 删除安全组规则
  1261. Method: http.MethodDelete,
  1262. Path: "/vm/deleteSecurityGroupRule",
  1263. Handler: vm.DeleteSecurityGroupRuleHandler(serverCtx),
  1264. },
  1265. {
  1266. // 删除虚拟机
  1267. Method: http.MethodDelete,
  1268. Path: "/vm/deleteServer",
  1269. Handler: vm.DeleteServerHandler(serverCtx),
  1270. },
  1271. {
  1272. // 删除子网
  1273. Method: http.MethodDelete,
  1274. Path: "/vm/deleteSubnet",
  1275. Handler: vm.DeleteSubnetHandler(serverCtx),
  1276. },
  1277. {
  1278. // 删除卷
  1279. Method: http.MethodDelete,
  1280. Path: "/vm/deleteVolume",
  1281. Handler: vm.DeleteVolumeHandler(serverCtx),
  1282. },
  1283. {
  1284. // 删除卷类型
  1285. Method: http.MethodDelete,
  1286. Path: "/vm/deleteVolumeType",
  1287. Handler: vm.DeleteVolumeTypeHandler(serverCtx),
  1288. },
  1289. {
  1290. // openstack计算中心概览
  1291. Method: http.MethodGet,
  1292. Path: "/vm/getComputeLimits",
  1293. Handler: vm.GetComputeLimitsHandler(serverCtx),
  1294. },
  1295. {
  1296. // 查询镜像数量
  1297. Method: http.MethodGet,
  1298. Path: "/vm/getImageNum",
  1299. Handler: vm.GetImageNumHandler(serverCtx),
  1300. },
  1301. {
  1302. // 查询网络数量
  1303. Method: http.MethodGet,
  1304. Path: "/vm/getNetworkNum",
  1305. Handler: vm.GetNetworkNumHandler(serverCtx),
  1306. },
  1307. {
  1308. // 查询虚拟机概览数据
  1309. Method: http.MethodGet,
  1310. Path: "/vm/getOpenstackOverview",
  1311. Handler: vm.GetOpenstackOverviewHandler(serverCtx),
  1312. },
  1313. {
  1314. // 根据ID查询虚拟机详情
  1315. Method: http.MethodGet,
  1316. Path: "/vm/getServersDetailedById",
  1317. Handler: vm.GetServersDetailedByIdHandler(serverCtx),
  1318. },
  1319. {
  1320. // 根据ID获取卷详情
  1321. Method: http.MethodGet,
  1322. Path: "/vm/getVolumeDetailedById",
  1323. Handler: vm.GetVolumeDetailedByIdHandler(serverCtx),
  1324. },
  1325. {
  1326. // 查询卷列表
  1327. Method: http.MethodGet,
  1328. Path: "/vm/getVolumeLimits",
  1329. Handler: vm.GetVolumeLimitsHandler(serverCtx),
  1330. },
  1331. {
  1332. // 查询防火墙列表
  1333. Method: http.MethodGet,
  1334. Path: "/vm/listFirewallGroups",
  1335. Handler: vm.ListFirewallGroupsHandler(serverCtx),
  1336. },
  1337. {
  1338. // 查询防火墙策略列表
  1339. Method: http.MethodGet,
  1340. Path: "/vm/listFirewallPolicies",
  1341. Handler: vm.ListFirewallPoliciesHandler(serverCtx),
  1342. },
  1343. {
  1344. // 查询防火墙策略列表
  1345. Method: http.MethodGet,
  1346. Path: "/vm/listFirewallRules",
  1347. Handler: vm.ListFirewallRulesHandler(serverCtx),
  1348. },
  1349. {
  1350. // 查询规格详情列表
  1351. Method: http.MethodGet,
  1352. Path: "/vm/listFlavorsDetail",
  1353. Handler: vm.ListFlavorsDetailHandler(serverCtx),
  1354. },
  1355. {
  1356. // 查询浮动ip列表
  1357. Method: http.MethodGet,
  1358. Path: "/vm/listFloatingIPs",
  1359. Handler: vm.ListFloatingIPsHandler(serverCtx),
  1360. },
  1361. {
  1362. // 查询镜像列表
  1363. Method: http.MethodGet,
  1364. Path: "/vm/listImages",
  1365. Handler: vm.ListImagesHandler(serverCtx),
  1366. },
  1367. {
  1368. // 查询网络列表
  1369. Method: http.MethodGet,
  1370. Path: "/vm/listNetworkSegmentRanges",
  1371. Handler: vm.ListNetworkSegmentRangesRangeHandler(serverCtx),
  1372. },
  1373. {
  1374. // 查询网络列表
  1375. Method: http.MethodGet,
  1376. Path: "/vm/listNetworks",
  1377. Handler: vm.ListNetworksHandler(serverCtx),
  1378. },
  1379. {
  1380. // 查询节点列表
  1381. Method: http.MethodGet,
  1382. Path: "/vm/listNodes",
  1383. Handler: vm.ListNodesHandler(serverCtx),
  1384. },
  1385. {
  1386. // 查询端口列表
  1387. Method: http.MethodGet,
  1388. Path: "/vm/listPortsReq",
  1389. Handler: vm.ListPortsHandler(serverCtx),
  1390. },
  1391. {
  1392. // 查询路由列表
  1393. Method: http.MethodGet,
  1394. Path: "/vm/listRouters",
  1395. Handler: vm.ListRoutersHandler(serverCtx),
  1396. },
  1397. {
  1398. // 查询安全组规则列表
  1399. Method: http.MethodGet,
  1400. Path: "/vm/listSecurityGroupRules",
  1401. Handler: vm.ListSecurityGroupRulesHandler(serverCtx),
  1402. },
  1403. {
  1404. // 查询安全组列表
  1405. Method: http.MethodGet,
  1406. Path: "/vm/listSecurityGroups",
  1407. Handler: vm.ListSecurityGroupsHandler(serverCtx),
  1408. },
  1409. {
  1410. // 查询虚拟机列表
  1411. Method: http.MethodGet,
  1412. Path: "/vm/listServer",
  1413. Handler: vm.ListServerHandler(serverCtx),
  1414. },
  1415. {
  1416. // 查询虚拟机详情列表
  1417. Method: http.MethodGet,
  1418. Path: "/vm/listServersDetailed",
  1419. Handler: vm.ListServersDetailedHandler(serverCtx),
  1420. },
  1421. {
  1422. // 查询子网列表
  1423. Method: http.MethodGet,
  1424. Path: "/vm/listSubnets",
  1425. Handler: vm.ListSubnetsHandler(serverCtx),
  1426. },
  1427. {
  1428. // 查询规格类型列表
  1429. Method: http.MethodGet,
  1430. Path: "/vm/listVolumeTypes",
  1431. Handler: vm.ListVolumeTypesHandler(serverCtx),
  1432. },
  1433. {
  1434. // 查询卷列表
  1435. Method: http.MethodGet,
  1436. Path: "/vm/listVolumes",
  1437. Handler: vm.ListVolumesHandler(serverCtx),
  1438. },
  1439. {
  1440. // 查询卷详情列表
  1441. Method: http.MethodGet,
  1442. Path: "/vm/listVolumesDetail",
  1443. Handler: vm.ListVolumesDetailHandler(serverCtx),
  1444. },
  1445. {
  1446. // 迁移
  1447. Method: http.MethodPost,
  1448. Path: "/vm/migrateServer",
  1449. Handler: vm.MigrateServerHandler(serverCtx),
  1450. },
  1451. {
  1452. // 暂停虚拟机
  1453. Method: http.MethodPost,
  1454. Path: "/vm/pauseServer",
  1455. Handler: vm.PauseServerHandler(serverCtx),
  1456. },
  1457. {
  1458. // 重启虚拟机
  1459. Method: http.MethodPost,
  1460. Path: "/vm/rebootServer",
  1461. Handler: vm.RebootServerHandler(serverCtx),
  1462. },
  1463. {
  1464. // 从服务器中删除安全
  1465. Method: http.MethodPost,
  1466. Path: "/vm/removeSecurityGroup",
  1467. Handler: vm.RemoveSecurityGroupHandler(serverCtx),
  1468. },
  1469. {
  1470. // 救援
  1471. Method: http.MethodPost,
  1472. Path: "/vm/rescueServer",
  1473. Handler: vm.RescueServerHandler(serverCtx),
  1474. },
  1475. {
  1476. // 调整大小
  1477. Method: http.MethodPost,
  1478. Path: "/vm/resizeServer",
  1479. Handler: vm.ResizeServerHandler(serverCtx),
  1480. },
  1481. {
  1482. // 搁置
  1483. Method: http.MethodPost,
  1484. Path: "/vm/shelveServer",
  1485. Handler: vm.ShelveServerHandler(serverCtx),
  1486. },
  1487. {
  1488. // 查询防火墙详情
  1489. Method: http.MethodGet,
  1490. Path: "/vm/showFirewallGroupDetails",
  1491. Handler: vm.ShowFirewallGroupDetailsHandler(serverCtx),
  1492. },
  1493. {
  1494. // 查询防火墙策略详情
  1495. Method: http.MethodGet,
  1496. Path: "/vm/showFirewallPolicyDetails",
  1497. Handler: vm.ShowFirewallPolicyDetailsHandler(serverCtx),
  1498. },
  1499. {
  1500. // 查询防火墙策略详情
  1501. Method: http.MethodGet,
  1502. Path: "/vm/showFirewallRuleDetails",
  1503. Handler: vm.ShowFirewallRuleDetailsHandler(serverCtx),
  1504. },
  1505. {
  1506. // 查询浮动ip详情
  1507. Method: http.MethodGet,
  1508. Path: "/vm/showFloatingIPDetails",
  1509. Handler: vm.ShowFloatingIPDetailsHandler(serverCtx),
  1510. },
  1511. {
  1512. // 查询网络详情
  1513. Method: http.MethodGet,
  1514. Path: "/vm/showNetworkDetails",
  1515. Handler: vm.ShowNetworkDetailsHandler(serverCtx),
  1516. },
  1517. {
  1518. // 显示网段详情
  1519. Method: http.MethodGet,
  1520. Path: "/vm/showNetworkSegmentRangeDetails",
  1521. Handler: vm.ShowNetworkSegmentRangeDetailsHandler(serverCtx),
  1522. },
  1523. {
  1524. // 查询节点详情
  1525. Method: http.MethodGet,
  1526. Path: "/vm/showNodeDetails",
  1527. Handler: vm.ShowNodeDetailsHandler(serverCtx),
  1528. },
  1529. {
  1530. // 查询端口详情
  1531. Method: http.MethodGet,
  1532. Path: "/vm/showPortDetails",
  1533. Handler: vm.ShowPortDetailsHandler(serverCtx),
  1534. },
  1535. {
  1536. // 查询路由详情
  1537. Method: http.MethodGet,
  1538. Path: "/vm/showRouterDetails",
  1539. Handler: vm.ShowRouterDetailsHandler(serverCtx),
  1540. },
  1541. {
  1542. // 查询安全组详情
  1543. Method: http.MethodGet,
  1544. Path: "/vm/showSecurityGroup",
  1545. Handler: vm.ShowSecurityGroupHandler(serverCtx),
  1546. },
  1547. {
  1548. // 查询安全组规则详情
  1549. Method: http.MethodGet,
  1550. Path: "/vm/showSecurityGroupRule",
  1551. Handler: vm.ShowSecurityGroupRuleHandler(serverCtx),
  1552. },
  1553. {
  1554. // 启动虚拟机
  1555. Method: http.MethodPost,
  1556. Path: "/vm/startServer",
  1557. Handler: vm.StartServerHandler(serverCtx),
  1558. },
  1559. {
  1560. // 停止虚拟机
  1561. Method: http.MethodPost,
  1562. Path: "/vm/stopServer",
  1563. Handler: vm.StopServerHandler(serverCtx),
  1564. },
  1565. {
  1566. // 中止
  1567. Method: http.MethodPost,
  1568. Path: "/vm/suspendServer",
  1569. Handler: vm.SuspendServerHandler(serverCtx),
  1570. },
  1571. {
  1572. // 取消救援
  1573. Method: http.MethodPost,
  1574. Path: "/vm/unRescueServer",
  1575. Handler: vm.UnRescueHandler(serverCtx),
  1576. },
  1577. {
  1578. // 取消暂停虚拟机
  1579. Method: http.MethodPost,
  1580. Path: "/vm/unpauseServer",
  1581. Handler: vm.UnpauseServerHandler(serverCtx),
  1582. },
  1583. {
  1584. // 修改防火墙
  1585. Method: http.MethodPut,
  1586. Path: "/vm/updateFirewallGroup",
  1587. Handler: vm.UpdateFirewallGroupHandler(serverCtx),
  1588. },
  1589. {
  1590. // 修改浮动ip
  1591. Method: http.MethodPut,
  1592. Path: "/vm/updateFloatingIP",
  1593. Handler: vm.UpdateFloatingIPHandler(serverCtx),
  1594. },
  1595. {
  1596. // 更新网络
  1597. Method: http.MethodPut,
  1598. Path: "/vm/updateNetwork",
  1599. Handler: vm.UpdateNetworkHandler(serverCtx),
  1600. },
  1601. {
  1602. // 修改网段
  1603. Method: http.MethodPut,
  1604. Path: "/vm/updateNetworkSegmentRanges",
  1605. Handler: vm.UpdateNetworkSegmentRangesHandler(serverCtx),
  1606. },
  1607. {
  1608. // 修改端口
  1609. Method: http.MethodPut,
  1610. Path: "/vm/updatePort",
  1611. Handler: vm.UpdatePortHandler(serverCtx),
  1612. },
  1613. {
  1614. // 修改路由
  1615. Method: http.MethodPut,
  1616. Path: "/vm/updateRouter",
  1617. Handler: vm.UpdateRouterHandler(serverCtx),
  1618. },
  1619. {
  1620. // 修改安全组
  1621. Method: http.MethodPut,
  1622. Path: "/vm/updateSecurityGroup",
  1623. Handler: vm.UpdateSecurityGroupHandler(serverCtx),
  1624. },
  1625. {
  1626. // 更新虚拟机
  1627. Method: http.MethodPut,
  1628. Path: "/vm/updateServer",
  1629. Handler: vm.UpdateServerHandler(serverCtx),
  1630. },
  1631. {
  1632. // 修改子网
  1633. Method: http.MethodPut,
  1634. Path: "/vm/updateSubnet",
  1635. Handler: vm.UpdateSubnetHandler(serverCtx),
  1636. },
  1637. {
  1638. // 更新卷
  1639. Method: http.MethodPut,
  1640. Path: "/vm/updateVolume",
  1641. Handler: vm.UpdateVolumeHandler(serverCtx),
  1642. },
  1643. {
  1644. // 上传镜像
  1645. Method: http.MethodPut,
  1646. Path: "/vm/uploadImage",
  1647. Handler: vm.UploadImageHandler(serverCtx),
  1648. },
  1649. },
  1650. rest.WithPrefix("/pcm/v1"),
  1651. )
  1652. }

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.