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

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

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.