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

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.