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.

resources.js 4.5 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. import service from '../service';
  2. // 查询智算列表
  3. export const getAiCenterList = () => {
  4. return service({
  5. url: '/admin/resources/queue/centers',
  6. method: 'get',
  7. params: {},
  8. data: {},
  9. });
  10. }
  11. // 查询资源队列列表
  12. // page 当前页数,从1开始
  13. // cluster 所属集群 :OpenI 启智集群,C2Net 智算集群
  14. // center 智算中心:OpenIOne 云脑一,OpenITwo 云脑二, chendu 成都人工智能计算中心, pclcci 鹏城云计算所 ,hefei 合肥类脑类脑智能开放平台, xuchang 中原人工智能计算中心
  15. // resource 计算资源: GPU NPU
  16. // card XPU类型: T4、A100、V100、Ascend 910
  17. export const getResQueueList = (params) => {
  18. return service({
  19. url: '/admin/resources/queue/list',
  20. method: 'get',
  21. params,
  22. });
  23. }
  24. // 新增资源队列
  25. export const addResQueue = (data) => { // Cluster,QueueCode,AiCenterCode,ComputeResource,AccCardType,CardsTotalNum,Remark
  26. return service({
  27. url: '/admin/resources/queue/add',
  28. method: 'post',
  29. params: {},
  30. data,
  31. });
  32. }
  33. // 更新资源队列
  34. export const updateResQueue = (data) => { // CardsTotalNum,Remark
  35. return service({
  36. url: `/admin/resources/queue/update/${data.ID}`,
  37. method: 'post',
  38. params: {},
  39. data,
  40. });
  41. }
  42. // 查询所有资源队列名称列表
  43. export const getResQueueCode = (params) => { // cluster
  44. return service({
  45. url: '/admin/resources/queue/codes',
  46. method: 'get',
  47. params,
  48. data: {},
  49. });
  50. }
  51. // 同步智算网络资源池(队列)
  52. export const syncResQueue = () => {
  53. return service({
  54. url: '/admin/resources/queue/grampus/sync',
  55. method: 'post',
  56. params: {},
  57. data: {},
  58. });
  59. }
  60. // 新增资源规格
  61. export const addResSpecification = (data) => {
  62. return service({
  63. url: '/admin/resources/specification/add',
  64. method: 'post',
  65. params: {},
  66. data,
  67. });
  68. }
  69. // 查询资源规格所属场景 - 下架时提醒
  70. export const getResSpecificationScenes = (data) => { // data => { ID: 1 }
  71. return service({
  72. url: `/admin/resources/specification/scenes/${data.ID}`,
  73. method: 'get',
  74. params: {},
  75. data: {}
  76. });
  77. }
  78. // 更新资源规格
  79. // params: action edit-编辑 on-shelf 上架 off-shelf 下架
  80. // data: UnitPrice
  81. export const updateResSpecification = (data) => { // data => { ID: 1, action: 'edit|on-shelf|off-shelf', UnitPrice: 1 | undefined }
  82. return service({
  83. url: `/admin/resources/specification/update/${data.ID}`,
  84. method: 'post',
  85. params: { action: data.action },
  86. data: { UnitPrice: data.action === 'edit' || data.action === 'on-shelf' ? data.UnitPrice : undefined }
  87. });
  88. }
  89. // 查询资源规格列表
  90. // page
  91. // cluster 所属集群 :OpenI 启智集群,C2Net 智算集群
  92. // queue 所属队列id
  93. // status 状态 : 1 待审核 2已上架 3已下架
  94. export const getResSpecificationList = (params) => {
  95. return service({
  96. url: '/admin/resources/specification/list',
  97. method: 'get',
  98. params,
  99. data: {},
  100. });
  101. }
  102. // 同步智算网络资源池(队列)
  103. export const syncResSpecification = () => {
  104. return service({
  105. url: '/admin/resources/specification/grampus/sync',
  106. method: 'post',
  107. params: {},
  108. data: {},
  109. });
  110. }
  111. // 新增资源应用场景
  112. /*
  113. {
  114. "SceneName":"启智集群调试任务", //应用场景名
  115. "JobType":"TRAIN", //任务类型 DEBUG调试任务 BENCHMARK 评测任务 TRAIN 训练 INFERENCE 推理
  116. "IsExclusive":true, //是否专属
  117. "ExclusiveOrg":"123,456", //专属组织
  118. "QueueId":2, //队列id
  119. "SpecIds":[2,3] // 资源规格id
  120. }
  121. */
  122. export const addResScene = (data) => {
  123. return service({
  124. url: '/admin/resources/scene/add',
  125. method: 'post',
  126. params: {},
  127. data,
  128. });
  129. }
  130. // 更新资源应用场景
  131. // params: action:edit-编辑 delete-删除,
  132. // data: {
  133. // "SceneName":"启智集群调试任务", //应用场景名
  134. // "IsExclusive":true, //是否专属
  135. // "ExclusiveOrg":"123,456", //专属组织
  136. // "SpecIds":[2,3] // 资源规格id
  137. //}
  138. export const updateResScene = (data) => {
  139. return service({
  140. url: `/admin/resources/scene/update/${data.ID}`,
  141. method: 'post',
  142. params: { action: data.action },
  143. data: {
  144. ...data
  145. },
  146. });
  147. }
  148. // 查询资源应用场景
  149. // page
  150. // jobType
  151. // center
  152. // queue 所属队列
  153. // IsExclusive 是否专属 1 专属 2 非专属
  154. export const getResSceneList = (params) => {
  155. return service({
  156. url: '/admin/resources/scene/list',
  157. method: 'get',
  158. params,
  159. data: {},
  160. });
  161. }