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.

pcm-core.api 46 kB

2 years ago
2 years ago
2 years ago
2 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306
  1. syntax = "v1"
  2. info(
  3. title: "gateway"
  4. desc: "gateway端微服务"
  5. author: "zhouqj"
  6. email: "450705171@qq.com"
  7. )
  8. type (
  9. getRegionResp {
  10. Code int32 `json:"code"`
  11. Msg string `json:"msg"`
  12. Data RegionNum `json:"data"`
  13. }
  14. RegionNum {
  15. RegionSum int64 `json:"regionSum"`
  16. SoftStackSum int64 `json:"softStackSum"`
  17. }
  18. )
  19. type (
  20. centerResourcesResp {
  21. CentersIndex []CenterIndex `json:"centersIndex"`
  22. }
  23. CenterIndex {
  24. Id int64 `json:"id"`
  25. Name string `json:"name"`
  26. Cpu string `json:"cpu"`
  27. Memory string `json:"memory"`
  28. Storage string `json:"storage"`
  29. CenterType string `json:"centerType"`
  30. }
  31. )
  32. type (
  33. HomeOverviewReq {
  34. }
  35. HomeOverviewResp {
  36. Code int `json:"code"`
  37. Message string `json:"message"`
  38. Data HomeOverviewData `json:"data"`
  39. }
  40. HomeOverviewData{
  41. AdaptSum int64 `json:"adaptSum"`
  42. ClusterSum int64 `json:"clusterSum"`
  43. StorageSum float32 `json:"storageSum"`
  44. TaskSum int64 `json:"taskSum"`
  45. }
  46. )
  47. type (
  48. PublicImageReq {
  49. }
  50. PublicImageResp {
  51. Code int `json:"code"`
  52. Message string `json:"message"`
  53. ImageDict []ImageDict `json:"imageRDict"`
  54. }
  55. ImageDict {
  56. Id int `json:"id"`
  57. PublicImageName string `json:"public_image_name"`
  58. }
  59. )
  60. type (
  61. PublicFlavorReq {
  62. }
  63. PublicFlavorResp {
  64. Code int `json:"code"`
  65. Message string `json:"message"`
  66. FlavorDict []FlavorDict `json:"flavorDict"`
  67. }
  68. FlavorDict {
  69. Id int `json:"id"`
  70. PublicFlavorName string `json:"public_flavor_name"`
  71. }
  72. )
  73. type (
  74. PublicNetworkReq {
  75. }
  76. PublicNetworkResp {
  77. Code int `json:"code"`
  78. Message string `json:"message"`
  79. NetworkDict []NetworkDict `json:"networkDict"`
  80. }
  81. NetworkDict {
  82. Id int `json:"id"`
  83. PublicNetworkName string `json:"public_netWork_name"`
  84. }
  85. )
  86. type remoteResp {
  87. Code int `json:"code"`
  88. Message string `json:"message"`
  89. Data interface{} `json:"data"`
  90. }
  91. type (
  92. clustersLoadReq {
  93. ClusterName string `form:"clusterName"`
  94. }
  95. clustersLoadResp {
  96. Data interface{} `json:"data"`
  97. }
  98. )
  99. type (
  100. syncClusterLoadReq {
  101. clusterLoadRecords []ClusterLoadRecord `json:"clusterLoadRecords"`
  102. }
  103. ClusterLoadRecord {
  104. AdapterId int64 `json:"adapterId,optional"`
  105. ClusterName string `json:"clusterName,optional"`
  106. CpuAvail float64 `json:"cpuAvail,optional"`
  107. CpuTotal float64 `json:"cpuTotal,optional"`
  108. CpuUtilisation float64 `json:"cpuUtilisation,optional"`
  109. MemoryAvail float64 `json:"memoryAvail,optional"`
  110. MemoryUtilisation float64 `json:"memoryUtilisation,optional"`
  111. MemoryTotal float64 `json:"memoryTotal,optional"`
  112. DiskAvail float64 `json:"diskAvail,optional"`
  113. DiskTotal float64 `json:"diskTotal,optional"`
  114. DiskUtilisation float64 `json:"diskUtilisation,optional"`
  115. PodsUtilisation float64 `json:"podsUtilisation,optional"`
  116. PodsCount int64 `json:"podsCount,optional"`
  117. PodsTotal int64 `json:"podsTotal,optional"`
  118. }
  119. )
  120. type (
  121. getClusterListReq {
  122. Id int64 `form:"id"`
  123. }
  124. getClusterListResp {
  125. Clusters []ClusterInfo `json:"clusters"`
  126. }
  127. )
  128. type (
  129. listRegionResp {
  130. Code int32 `json:"code"`
  131. Msg string `json:"msg"`
  132. Data []Region `json:"data"`
  133. }
  134. Region {
  135. RegionName string `json:"RegionName"` // 域名
  136. SoftStack string `json:"SoftStack"` // 软件栈
  137. SlurmNum int64 `json:"SlurmNum"` // 超算域适配slurm数量
  138. AdaptorInterfaceSum int64 `json:"AdaptorInterfaceSum"` // 适配接口数量
  139. RunningJobs int64 `json:"runningJobs"`
  140. }
  141. )
  142. type (
  143. GeneralTaskReq {
  144. Name string `json:"name"`
  145. AdapterIds []string `json:"adapterIds"`
  146. ClusterIds []string `json:"clusterIds"`
  147. Strategy string `json:"strategy"`
  148. StaticWeightMap map[string]int32 `json:"staticWeightMap,optional"`
  149. ReqBody []string `json:"reqBody"`
  150. Replicas int64 `json:"replicas,string"`
  151. }
  152. PodLogsReq {
  153. TaskId string `json:"taskId"`
  154. TaskName string `json:"taskName"`
  155. ClusterId string `json:"clusterId"`
  156. ClusterName string `json:"clusterName"`
  157. AdapterId string `json:"adapterId"`
  158. AdapterName string `json:"adapterName"`
  159. PodName string `json:"podName"`
  160. stream bool `json:"stream"`
  161. }
  162. )
  163. type deleteTaskReq {
  164. Id int64 `path:"id"`
  165. }
  166. type commitTaskReq {
  167. Name string `json:"name"`
  168. NsID string `json:"nsID"`
  169. Replicas int64 `json:"replicas,optional"`
  170. MatchLabels map[string]string `json:"matchLabels,optional"`
  171. YamlList []string `json:"yamlList"`
  172. ClusterName string `json:"clusterName"`
  173. }
  174. type (
  175. scheduleTaskByYamlReq {
  176. Name string `yaml:"name"`
  177. Description string `yaml:"description"`
  178. TenantId int64 `yaml:"tenantId"`
  179. NsID string `yaml:"nsID"`
  180. Tasks []TaskYaml `yaml:"tasks"`
  181. }
  182. TaskYaml {
  183. Replicas int64 `yaml:"replicas"`
  184. TaskId int64 `yaml:"taskId"`
  185. NsID string `yaml:"nsID"`
  186. TaskType string `yaml:"taskType"`
  187. ParticipantId int64 `yaml:"participantId"`
  188. MatchLabels map[string]string `yaml:"matchLabels"`
  189. Metadata interface{} `yaml:"metadata"`
  190. }
  191. )
  192. type (
  193. commitVmTaskReq {
  194. Name string `json:"name"`
  195. AdapterIds []string `json:"adapterIds,optional"`
  196. ClusterIds []string `json:"clusterIds"`
  197. Strategy string `json:"strategy"`
  198. StaticWeightMap map[string]int32 `json:"staticWeightMap,optional"`
  199. MinCount int64 `json:"min_count,optional"`
  200. ImageRef int64 `json:"imageRef,optional"`
  201. FlavorRef int64 `json:"flavorRef,optional"`
  202. Uuid int64 `json:"uuid,optional"`
  203. Replicas int64 `json:"replicas,string"`
  204. VmName string `json:"vm_name,optional"`
  205. }
  206. TaskVm {
  207. Image string `json:"image"`
  208. Flavor string `json:"flavor"`
  209. Uuid string `json:"uuid"`
  210. Platform string `json:"platform"`
  211. }
  212. VmOption {
  213. AdapterId string `json:"adapterId"`
  214. VmClusterIds []string `json:"vmClusterIds"`
  215. Replicas int64 `json:"replicas,optional"`
  216. Name string `json:"name"`
  217. //ResourceType string `json:"resourceType"`
  218. //TaskType string `json:"taskType"`
  219. Strategy string `json:"strategy"`
  220. ClusterToStaticWeight map[string]int32 `json:"clusterToStaticWeight"`
  221. MatchLabels map[string]string `json:"matchLabels,optional"`
  222. StaticWeightMap map[string]int32 `json:"staticWeightMap,optional"`
  223. CreateMulServer []CreateMulDomainServer `json:"createMulServer,optional"`
  224. }
  225. CreateMulDomainServer {
  226. Platform string `json:"platform,optional"`
  227. name string `json:"name,optional"`
  228. min_count int64 `json:"min_count,optional"`
  229. imageRef string `json:"imageRef,optional"`
  230. flavorRef string `json:"flavorRef,optional"`
  231. uuid string `json:"uuid,optional"`
  232. ClusterId string `json:"clusterId,optional"`
  233. }
  234. commitVmTaskResp {
  235. Code int32 `json:"code"`
  236. Msg string `json:"msg"`
  237. }
  238. ScheduleVmResult struct {
  239. ClusterId string `json:"clusterId"`
  240. TaskId string `json:"taskId"`
  241. Strategy string `json:"strategy"`
  242. Replica int32 `json:"replica"`
  243. Msg string `json:"msg"`
  244. }
  245. VmTask{
  246. Id string `json:"id" copier:"Id"`
  247. Links []VmLinks `json:"links" copier:"Links"`
  248. OSDCFDiskConfig string `json:"OS_DCF_diskConfig" copier:"OSDCFDiskConfig"`
  249. SecurityGroups []VmSecurity_groups_server `json:"security_groups" copier:"SecurityGroups"`
  250. AdminPass string `json:"adminPass" copier:"AdminPass"`
  251. }
  252. VmLinks {
  253. Href string `json:"href " copier:"Href"`
  254. Rel string `json:"rel" copier:"Rel"`
  255. }
  256. // commitVmTaskReq {
  257. // Name string `json:"name"`
  258. // NsID string `json:"nsID"`
  259. // Replicas int64 `json:"replicas,optional"`
  260. // MatchLabels map[string]string `json:"matchLabels,optional"`
  261. // AdapterId string `json:"adapterId,optional"`
  262. // ClusterType string `json:"clusterType,optional"`
  263. // //Virtual Machine Section
  264. // CreateMulServer []CreateMulDomainServer `json:"createMulServer,optional"`
  265. // }
  266. // CreateMulDomainServer {
  267. // Platform string `json:"platform,optional"`
  268. // Name string `json:"name,optional"`
  269. // Min_count int64 `json:"min_count,optional"`
  270. // ImageRef string `json:"imageRef,optional"`
  271. // FlavorRef string `json:"flavorRef,optional"`
  272. // Uuid string `json:"uuid,optional"`
  273. // }
  274. // commitVmTaskResp {
  275. // // VmTask []VmTask `json:"vmTask" copier:"VmTask"`
  276. // TaskId int64 `json:"taskId"`
  277. // Code int32 `json:"code"`
  278. // Msg string `json:"msg"`
  279. // }
  280. // VmTask {
  281. // Id string `json:"id" copier:"Id"`
  282. // Links []VmLinks `json:"links" copier:"Links"`
  283. // OSDCFDiskConfig string `json:"OS_DCF_diskConfig" copier:"OSDCFDiskConfig"`
  284. // SecurityGroups []VmSecurity_groups_server `json:"security_groups" copier:"SecurityGroups"`
  285. // AdminPass string `json:"adminPass" copier:"AdminPass"`
  286. // }
  287. // VmLinks {
  288. // Href string `json:"href " copier:"Href"`
  289. // Rel string `json:"rel" copier:"Rel"`
  290. // }
  291. VmSecurity_groups_server {
  292. Name string `json:"name" copier:"Name"`
  293. }
  294. )
  295. type (
  296. scheduleTaskByYamlResp {
  297. TaskId int64 `json:"taskId"`
  298. }
  299. )
  300. type (
  301. scheduleTaskReq {
  302. Name string `json:"name"`
  303. Synergy string `json:"synergy"`
  304. Description string `json:"description"`
  305. Strategy string `json:"strategy"`
  306. Tasks []TaskInfo `json:"tasks"`
  307. }
  308. TaskInfo {
  309. TaskId int64 `json:"taskId,optional"`
  310. TaskType string `json:"taskType,optional"`
  311. MatchLabels map[string]string `json:"matchLabels"`
  312. ParticipantId int64 `json:"participantId"`
  313. Metadata interface{} `json:"metadata"`
  314. }
  315. )
  316. type (
  317. jobTotalResp {
  318. AllCardRunTime float64 `json:"allCardRunTime"`
  319. AllJobCount float64 `json:"allJobCount"`
  320. AllJobRunTime float64 `json:"allJobRunTime"`
  321. TrainJobs []TrainJob `json:"trainJobs"`
  322. }
  323. TrainJob {
  324. Name string `json:"name"`
  325. Status string `json:"status"`
  326. ParticipantName string `json:"participantName"`
  327. SynergyStatus string `json:"synergyStatus"`
  328. Strategy int `json:"strategy"`
  329. }
  330. )
  331. // 任务列表参数
  332. type (
  333. taskListReq {
  334. PageNum int `form:"pageNum"`
  335. PageSize int `form:"pageSize"`
  336. }
  337. taskListResp {
  338. TotalCount int64 `json:"totalCount"` // 任务总数
  339. NormalCount int64 `json:"normalCount"` // 正常任务数
  340. AlarmCount int64 `json:"alarmCount"` // 任务告警数
  341. Tasks []Task `json:"tasks"`
  342. }
  343. Task {
  344. Id int64 `json:"id"`
  345. Name string `json:"name"`
  346. Status string `json:"status"`
  347. TaskType string `json:"taskType"`
  348. StartTime string `json:"startTime"`
  349. EndTime string `json:"endTime"`
  350. ParticipantStatus string `json:"participantStatus"`
  351. ParticipantId int64 `json:"participantId"`
  352. ParticipantName string `json:"participantName"`
  353. }
  354. pageTaskReq {
  355. Name string `form:"name,optional"`
  356. PageInfo
  357. }
  358. TaskModel {
  359. Id int64 `json:"id,omitempty,string" db:"id"` // id
  360. Name string `json:"name,omitempty" db:"name"` // 作业名称
  361. Description string `json:"description,omitempty" db:"description"` // 作业描述
  362. Status string `json:"status,omitempty" db:"status"` // 作业状态
  363. Strategy int64 `json:"strategy" db:"strategy"` // 策略
  364. SynergyStatus int64 `json:"synergyStatus" db:"synergy_status"` // 协同状态(0-未协同、1-已协同)
  365. CommitTime string `json:"commitTime,omitempty" db:"commit_time"` // 提交时间
  366. StartTime string `json:"startTime,omitempty" db:"start_time"` // 开始时间
  367. EndTime string `json:"endTime,omitempty" db:"end_time"` // 结束运行时间
  368. RunningTime int64 `json:"runningTime" db:"running_time"` // 已运行时间(单位秒)
  369. YamlString string `json:"yamlString,omitempty" db:"yaml_string"`
  370. Result string `json:"result,omitempty" db:"result"` // 作业结果
  371. DeletedAt string `json:"deletedAt,omitempty" gorm:"index" db:"deleted_at"`
  372. NsID string `json:"nsId,omitempty" db:"ns_id"`
  373. TenantId string `json:"tenantId,omitempty" db:"tenant_id"`
  374. CreatedTime string `json:"createdTime,omitempty" db:"created_time" gorm:"autoCreateTime"`
  375. UpdatedTime string `json:"updatedTime,omitempty" db:"updated_time"`
  376. AdapterTypeDict string `json:"adapterTypeDict" db:"adapter_type_dict" gorm:"adapter_type_dict"` //适配器类型(对应字典表的值
  377. TaskTypeDict string `json:"taskTypeDict" db:"task_type_dict" gorm:"task_type_dict"` //任务类型(对应字典表的值
  378. }
  379. )
  380. // 任务列表参数
  381. type (
  382. taskDetailReq {
  383. TaskId int64 `path:"taskId"`
  384. }
  385. taskDetailResp {
  386. CpuCores float64 `json:"cpuCores"`
  387. CpuRate float64 `json:"cpuRate"`
  388. CpuLimit float64 `json:"cpuLimit"`
  389. GpuCores float64 `json:"gpuCores"`
  390. GpuRate float64 `json:"gpuRate"`
  391. GpuLimit float64 `json:"gpuLimit"`
  392. MemoryTotal float64 `json:"memoryTotal"`
  393. MemoryRate float64 `json:"memoryRate"`
  394. MemoryLimit float64 `json:"memoryLimit"`
  395. }
  396. )
  397. type (
  398. listCenterResp {
  399. Code int32 `json:"code"`
  400. Msg string `json:"msg"`
  401. Data CenterData `json:"data"`
  402. }
  403. CenterData {
  404. TotalCount int `json:"totalCount"`
  405. Centers []Center `json:"centers"`
  406. }
  407. Center {
  408. Id int64 `json:"id"`
  409. CenterSource string `json:"centerSource"`
  410. SourceId string `json:"sourceId"`
  411. Name string `json:"name"`
  412. Description string `json:"description"`
  413. Type string `json:"type"`
  414. Area string `json:"area"`
  415. City string `json:"city"`
  416. Longitude float64 `json:"longitude"`
  417. Latitude float64 `json:"latitude"`
  418. Status string `json:"status"`
  419. UserNum int64 `json:"userNum"`
  420. DeletedFlag int64 `json:"deletedFlag"`
  421. CloudClusterNum int64 `json:"cloudClusterNum"`
  422. CloudNodeNum int64 `json:"cloudNodeNum"`
  423. CloudCpuNum int64 `json:"cloudCpuNum"`
  424. CloudGpuNum int64 `json:"cloudGpuNum"`
  425. CloudMngFlops int64 `json:"cloudMngFlops"`
  426. CloudUmngFlops int64 `json:"cloudUmngFlops"`
  427. CloudMngStorage int64 `json:"cloudMngStorage"`
  428. CloudUmngStorage int64 `json:"cloudUmngStorage"`
  429. AiClusterNum int64 `json:"aiClusterNum"`
  430. AiNodeNum int64 `json:"aiNodeNum"`
  431. AiCpuNum int64 `json:"aiCpuNum"`
  432. AiGpuNum int64 `json:"aiGpuNum"`
  433. AiMngFlops int64 `json:"aiMngFlops"`
  434. AiUmngFlops int64 `json:"aiUmngFlops"`
  435. AiMngStorage int64 `json:"aiMngStorage"`
  436. AiUmngStorage int64 `json:"aiUmngStorage"`
  437. HpcClusterNum int64 `json:"hpcClusterNum"`
  438. HpcNodeNum int64 `json:"hpcNodeNum"`
  439. HpcCpuNum int64 `json:"hpcCpuNum"`
  440. HpcGpuNum int64 `json:"hpcGpuNum"`
  441. HpcMngFlops int64 `json:"hpcMngFlops"`
  442. HpcUmngFlops int64 `json:"hpcUmngFlops"`
  443. HpcMngStorage int64 `json:"hpcMngStorage"`
  444. HpcUmngStorage int64 `json:"hpcUmngStorage"`
  445. Edwc bool `json:"edwc"`
  446. Ydyl bool `json:"ydyl"`
  447. HubCode int64 `json:"hubCode"`
  448. }
  449. )
  450. type (
  451. listClusterReq {
  452. CenterId int32 `path:"centerId"`
  453. }
  454. listClusterResp {
  455. Code int32 `json:"code"`
  456. Msg string `json:"msg"`
  457. Data ClusterData `json:"data"`
  458. }
  459. ClusterData {
  460. TotalCount int `json:"totalCount"`
  461. Clusters []ComputeCluster `json:"clusters"`
  462. }
  463. ComputeCluster {
  464. Id int64 `json:"id"`
  465. Name string `json:"name"`
  466. Type string `json:"type"`
  467. JcceDomainId int64 `json:"jcceDomainId"`
  468. JcceDomainName string `json:"jcceDomainName"`
  469. Longitude float64 `json:"longitude"`
  470. Latitude float64 `json:"latitude"`
  471. Description string `json:"description"`
  472. }
  473. )
  474. type ScreenChartResp {
  475. ComputingPower []int `json:"computingPower"`
  476. CpuAvg []int `json:"cpuAvg"`
  477. CpuLoad []int `json:"cpuLoad"`
  478. MemoryLoad []int `json:"memoryLoad"`
  479. MemoryAvg []int `json:"memoryAvg"`
  480. CenterName string `json:"centerName"`
  481. }
  482. type ScreenInfoResp {
  483. StorageUsed float32 `json:"storageUsed"`
  484. StorageUsing float32 `json:"storageUsing"`
  485. UsageRate float32 `json:"usageRate"`
  486. UsingRate float32 `json:"usingRate"`
  487. ApiDelay string `json:"apiDelay"`
  488. SchedulerTimes int `json:"schedulerTimes"`
  489. SchedulerErr int `json:"schedulerErr"`
  490. ApiTimes string `json:"apiTimes"`
  491. CenterCount int `json:"centerCount"`
  492. ComputingPower float64 `json:"computingPower"`
  493. ClusterCount int `json:"clusterCount"`
  494. RunningCount int `json:"runningCount"`
  495. CardCount int `json:"cardCount"`
  496. RunningTime int `json:"runningTime"`
  497. }
  498. type (
  499. cpResp {
  500. POpsAtFp16 float32 `json:"pOpsAtFp16"`
  501. }
  502. GiResp {
  503. CpuNum int32 `json:"cpuNum,optional"`
  504. MemoryInGib int32 `json:"memoryInGib,optional"`
  505. StorageInGib int32 `json:"storageInGib,optional"`
  506. }
  507. )
  508. type (
  509. DomainResourceResp {
  510. TotalCount int `json:"totalCount"`
  511. DomainResourceList []DomainResource `json:"domainResourceList"`
  512. }
  513. DomainResource {
  514. Id int64 `json:"id"` // id
  515. DomainId string `json:"domainId"` // 资源域id
  516. DomainName string `json:"domainName"` // 资源域名称
  517. JobCount int64 `json:"jobCount"` // 资源域任务数量
  518. DomainSource int64 `json:"domainSource"` // 资源域数据来源:0-nudt,1-鹏城
  519. Stack string `json:"stack"` // 技术栈
  520. ResourceType string `json:"resourceType"` // 资源类型
  521. Cpu float64 `json:"cpu"` // cpu使用率
  522. Memory float64 `json:"memory"` // 内存使用率
  523. Disk float64 `json:"disk"` // 存储使用率
  524. NodeCount float64 `json:"nodeCount"` //节点使用率
  525. // DeleteFlag int64 `json:"delete_flag"` // 是否删除 0:未删除,1:已经删除
  526. Description string `json:"description"` //集群描述
  527. ClusterName string `json:"clusterName"` //集群名称
  528. CpuTotal float64 `json:"cpuTotal"` //cpu总核数
  529. MemoryTotal float64 `json:"memoryTotal"` //内存总量Gi
  530. DiskTotal float64 `json:"diskTotal"` //存储总量GB
  531. NodeTotal float64 `json:"nodeTotal"` //容器节点数
  532. CpuUsage float64 `json:"cpuUsage"` //cpu已使用核数
  533. MemoryUsage float64 `json:"memoryUsage"` //内存已使用Gi
  534. DiskUsage float64 `json:"diskUsage"` //存储已使用GB
  535. NodeUsage float64 `json:"nodeUsage"` //容器节点已使用
  536. }
  537. )
  538. type (
  539. ResourcePanelConfigReq {
  540. Id int64 `json:"id"` //id
  541. Title string `json:"title"` //标题
  542. TitleColor string `json:"titleColor"` //标题色
  543. MainColor string `json:"mainColor"` //主色调
  544. MainColor2 string `json:"mainColor2"` //次主色调
  545. TextColor string `json:"textColor"` //文字颜色
  546. BackgroundColor string `json:"backgroundColor"` //背景底色
  547. Center string `json:"center"` //中心点
  548. CenterPosition string `json:"centerPosition"` //comment 中心点坐标
  549. ProvinceBgColor string `json:"provinceBgColor"` //三级地图底色
  550. StatusIng string `json:"statusIng"` //接入中图标
  551. StatusUn string `json:"statusUn"` //未接入图标
  552. StatusEnd string `json:"statusEnd"` //已接入图标
  553. TitleIcon string `json:"titleIcon"` //标题底图
  554. SubTitleIcon string `json:"subTitleIcon"` //小标题底图
  555. NumberBg string `json:"numberBg"` //数字底图
  556. TaskBg string `json:"taskBg"` //任务底图
  557. }
  558. ResourcePanelConfigResp {
  559. Id int64 `json:"id"` //id
  560. Title string `json:"title"` //标题,
  561. TitleColor string `json:"titleColor"` //标题色,
  562. MainColor string `json:"mainColor"` //主色调,
  563. MainColor2 string `json:"mainColor2"` //次主色调,
  564. TextColor string `json:"textColor"` //文字颜色,
  565. BackgroundColor string `json:"backgroundColor"` //背景底色,
  566. Center string `json:"center"` //中心点,
  567. CenterPosition string `json:"centerPosition"` //comment 中心点坐标,
  568. ProvinceBgColor string `json:"provinceBgColor"` //三级地图底色,
  569. StatusIng string `json:"statusIng"` //接入中图标,
  570. StatusUn string `json:"statusUn"` //未接入图标,
  571. StatusEnd string `json:"statusEnd"` //已接入图标,
  572. TitleIcon string `json:"titleIcon"` //标题底图,
  573. SubTitleIcon string `json:"subTitleIcon"` //小标题底图,
  574. NumberBg string `json:"numberBg"` //数字底图,
  575. TaskBg string `json:"taskBg"` //任务底图,
  576. CreateTime string `json:"createTime"` //创建时间,
  577. UpdateTime string `json:"updateTime"` //更新时间
  578. }
  579. )
  580. type (
  581. ComputilityStatisticsResp {
  582. Code int32 `json:"code,omitempty"`
  583. Msg string `json:"msg,omitempty"`
  584. ErrorMsg string `json:"ErrorMsg,omitempty"`
  585. ComputilityStatistics ComputilityStatistics `json:"data"` //容器节点已使用
  586. }
  587. ComputilityStatistics {
  588. DomainSum int64 `json:"domainSum"` //域总数
  589. TotalComputility float64 `json:"totalComputility"` //算力总和
  590. ClusterNum int64 `json:"clusterNum"` //集群总数
  591. }
  592. )
  593. //jccSchedule容器集群资源监控 > start
  594. type NodeAssetsResp {
  595. NodeAssets []NodeAsset `json:"nodeAssets"`
  596. }
  597. type NodeAsset {
  598. Name string `json:"Name"` //租户名称
  599. NodeName string `json:"NodeName"` // 节点名称
  600. CpuTotal int64 `json:"CpuTotal"` // cpu核数
  601. CpuUsable float64 `json:"CpuUsable"` // cpu可用率
  602. DiskTotal int64 `json:"DiskTotal"` // 磁盘空间
  603. DiskAvail int64 `json:"DiskAvail"` // 磁盘可用空间
  604. MemTotal int64 `json:"MemTotal"` // 内存总数
  605. MemAvail int64 `json:"MemAvail"` // 内存可用数
  606. GpuTotal int64 `json:"GpuTotal"` // gpu总数
  607. GpuAvail int64 `json:"GpuAvail"` // gpu可用数
  608. ParticipantId int64 `json:"ParticipantId"` // 集群动态信息id
  609. }
  610. type participantListResp {
  611. Participants []Participant `json:"participants"`
  612. }
  613. type Participant {
  614. Id int64 `json:"id"`
  615. Name string `json:"name"`
  616. Address string `json:"address"`
  617. MetricsUrl string `json:"metricsUrl"`
  618. TenantName string `json:"tenantName"`
  619. TypeName string `json:"typeName"`
  620. }
  621. // apps列表参数
  622. type (
  623. AppListReq {
  624. NsID string `form:"nsID"`
  625. }
  626. AppListResp {
  627. Apps []App `json:"apps"` //应用列表
  628. }
  629. Replica {
  630. ClusterName string `json:"clusterName"`
  631. Replica int32 `json:"replica"`
  632. }
  633. App {
  634. Id int64 `json:"id,optional" db:"id"`
  635. Name string `json:"name,optional"`
  636. Status string `json:"status,optional"`
  637. CreateTime string `json:"createTime,optional"`
  638. MinReplicas string `json:"minReplicas,optional"`
  639. MaxReplicas string `json:"maxReplicas,optional"`
  640. AppLocations []AppLocation `json:"appLocations,optional"`
  641. }
  642. AppLocation {
  643. ParticipantId string `json:"participantId,optional" db:"participant_id"`
  644. ParticipantName string `json:"participantName,optional" db:"participant_name"`
  645. Kind string `json:"kind,optional" db:"kind"`
  646. }
  647. )
  648. //apps 详情参数
  649. type (
  650. AppDetailReq {
  651. Name string `path:"appName"`
  652. NsID string `form:"nsID"`
  653. }
  654. AppDetailResp {
  655. CpuCores float64 `json:"cpuCores"`
  656. CpuRate float64 `json:"cpuRate"`
  657. CpuLimit float64 `json:"cpuLimit"`
  658. GpuCores float64 `json:"gpuCores"`
  659. GpuRate float64 `json:"gpuRate"`
  660. GpuLimit float64 `json:"gpuLimit"`
  661. MemoryTotal float64 `json:"memoryTotal"`
  662. MemoryRate float64 `json:"memoryRate"`
  663. MemoryLimit float64 `json:"memoryLimit"`
  664. }
  665. AppTaskResp {
  666. Data interface{} `json:"data"`
  667. }
  668. )
  669. type (
  670. DeleteAppReq {
  671. Name string `form:"name"`
  672. NsID string `form:"nsID"`
  673. }
  674. DeleteAppResp {
  675. Code int `json:"code,omitempty"`
  676. Msg string `json:"msg,omitempty"`
  677. Data interface{} `json:"data,omitempty"`
  678. }
  679. AppResp {
  680. Code int `json:"code,omitempty"`
  681. Msg string `json:"msg,omitempty"`
  682. Data interface{} `json:"data,omitempty"`
  683. }
  684. )
  685. type (
  686. AdapterQueryReq {
  687. Id string `form:"id,optional" db:"id"`
  688. Name string `form:"name,optional"`
  689. Type string `form:"type,optional"`
  690. ResourceType string `form:"resourceType,optional"`
  691. Nickname string `form:"nickname,optional"`
  692. Version string `form:"version,optional"`
  693. Server string `form:"server,optional"`
  694. PageInfo
  695. }
  696. AdapterRelationQueryReq {
  697. Id string `form:"id,optional" db:"id"`
  698. Name string `form:"name,optional"`
  699. Type string `form:"type,optional"`
  700. ResourceType string `form:"resourceType,optional"`
  701. Nickname string `form:"nickname,optional"`
  702. Version string `form:"version,optional"`
  703. Server string `form:"server,optional"`
  704. }
  705. AdapterReq {
  706. Id string `json:"id,optional" db:"id"`
  707. Name string `json:"name,optional"`
  708. Type string `json:"type,optional"`
  709. ResourceType string `json:"resourceType,optional"`
  710. Nickname string `json:"nickname,optional"`
  711. Version string `json:"version,optional"`
  712. Server string `json:"server,optional"`
  713. }
  714. AdapterCreateReq {
  715. Id string `json:"id,optional" db:"id"`
  716. Name string `json:"name"`
  717. Type string `json:"type"`
  718. ResourceType string `json:"resourceType"`
  719. Nickname string `json:"nickname"`
  720. Version string `json:"version"`
  721. Server string `json:"server"`
  722. }
  723. AdapterDelReq {
  724. Id string `form:"id,optional" db:"id"`
  725. }
  726. AdapterInfo {
  727. Id string `json:"id,omitempty" db:"id"`
  728. Name string `json:"name,omitempty" db:"name"`
  729. Type string `json:"type,omitempty" db:"type"`
  730. ResourceType string `json:"resourceType,omitempty" db:"resource_type"`
  731. Nickname string `json:"nickname,omitempty" db:"nickname"`
  732. Version string `json:"version,omitempty" db:"version"`
  733. Server string `json:"server,omitempty" db:"server"`
  734. CreateTime string `json:"createTime,omitempty" db:"create_time" gorm:"autoCreateTime"`
  735. }
  736. AdapterResp {
  737. Id string `json:"id,omitempty" db:"id"`
  738. Name string `json:"name,omitempty" db:"name"`
  739. Type string `json:"type,omitempty" db:"type"`
  740. ResourceType string `json:"resourceType,omitempty" db:"resource_type"`
  741. Nickname string `json:"nickname,omitempty" db:"nickname"`
  742. Version string `json:"version,omitempty" db:"version"`
  743. Server string `json:"server,omitempty" db:"server"`
  744. CreateTime string `json:"createTime,omitempty" db:"create_time" gorm:"autoCreateTime"`
  745. }
  746. AdapterListResp {
  747. List []AdapterInfo `json:"list,omitempty"`
  748. }
  749. AdapterRelationResp {
  750. List []*ClusterRelationInfo `json:"list,omitempty"`
  751. }
  752. AdapterRelation {
  753. Id string `json:"id,omitempty" db:"id"`
  754. Name string `json:"name,omitempty" db:"name"`
  755. Type string `json:"type,omitempty" db:"type"`
  756. ResourceType string `json:"resourceType" db:"resource_type"`
  757. Nickname string `json:"nickname,omitempty" db:"nickname"`
  758. Version string `json:"version,omitempty" db:"version"`
  759. Server string `json:"server,omitempty" db:"server"`
  760. CreateTime string `json:"createTime,omitempty" db:"create_time" gorm:"autoCreateTime"`
  761. Clusters []*ClusterInfo `json:"clusters,omitempty"`
  762. }
  763. )
  764. type (
  765. ClusterReq {
  766. Id string `form:"id,optional"`
  767. AdapterId string `form:"adapterId,optional"`
  768. Name string `form:"name,optional"`
  769. Nickname string `form:"nickname,optional"`
  770. Description string `form:"description,optional"`
  771. Server string `form:"server,optional"`
  772. MonitorServer string `form:"monitorServer,optional"`
  773. Username string `form:"username,optional"`
  774. Password string `form:"password,optional"`
  775. Token string `form:"token,optional"`
  776. Ak string `form:"ak,optional"`
  777. Sk string `form:"sk,optional"`
  778. Region string `form:"region,optional"`
  779. ProjectId string `form:"projectId,optional"`
  780. Version string `form:"version,optional"`
  781. Label string `form:"label,optional"`
  782. OwnerId string `form:"ownerId,omitempty,optional"`
  783. AuthType string `form:"authType,optional"`
  784. Type string `form:"type,optional"`
  785. ProducerDict string `form:"producerDict,optional"`
  786. RegionDict string `form:"regionDict,optional"`
  787. ResourceType string `form:"resourceType,optional"`
  788. PageInfo
  789. }
  790. ClusterCreateReq {
  791. Id string `json:"id,optional"`
  792. AdapterId string `json:"adapterId,optional"`
  793. Name string `json:"name,optional"`
  794. Nickname string `json:"nickname,optional"`
  795. Description string `json:"description,optional"`
  796. Server string `json:"server,optional"`
  797. MonitorServer string `json:"monitorServer,optional"`
  798. Username string `json:"username,optional"`
  799. Password string `json:"password,optional"`
  800. Token string `json:"token,optional"`
  801. Ak string `json:"ak,optional"`
  802. Sk string `json:"sk,optional"`
  803. Region string `json:"region,optional"`
  804. ProjectId string `json:"projectId,optional"`
  805. Version string `json:"version,optional"`
  806. Label string `json:"label,optional"`
  807. OwnerId string `json:"ownerId,omitempty,optional"`
  808. AuthType string `json:"authType,optional"`
  809. ProducerDict string `json:"producerDict,optional"`
  810. RegionDict string `json:"regionDict,optional"`
  811. }
  812. ClusterInfo {
  813. Id string `json:"id,omitempty" db:"id"`
  814. AdapterId string `json:"adapterId,omitempty" db:"adapter_id"`
  815. Name string `json:"name,omitempty" db:"name"`
  816. Nickname string `json:"nickname,omitempty" db:"nickname"`
  817. Description string `json:"description,omitempty" db:"description"`
  818. Server string `json:"server,omitempty" db:"server"`
  819. MonitorServer string `json:"monitorServer,omitempty" db:"monitor_server"`
  820. Username string `json:"username,omitempty" db:"username"`
  821. Password string `json:"password,omitempty" db:"password"`
  822. Token string `json:"token,omitempty" db:"token"`
  823. Ak string `json:"ak,omitempty" db:"ak"`
  824. Sk string `json:"sk,omitempty" db:"sk"`
  825. Region string `json:"region,omitempty" db:"region"`
  826. ProjectId string `json:"projectId,omitempty" db:"project_id"`
  827. Version string `json:"version,omitempty" db:"version"`
  828. Label string `json:"label,omitempty" db:"label"`
  829. OwnerId string `json:"ownerId,omitempty" db:"owner_id"`
  830. AuthType string `json:"authType,omitempty" db:"auth_type"`
  831. ProducerDict string `json:"producerDict,omitempty" db:"producer_dict"`
  832. RegionDict string `json:"regionDict,omitempty" db:"region_dict"`
  833. CreateTime string `json:"createTime,omitempty" db:"created_time" gorm:"autoCreateTime"`
  834. }
  835. )
  836. type ClusterDelReq {
  837. Id string `form:"id,optional"`
  838. }
  839. type ClusterResp {
  840. List ClusterInfo `json:"list,omitempty"`
  841. }
  842. type ClusterListResp {
  843. List []ClusterInfo `json:"list,omitempty"`
  844. }
  845. type clusterSumReq {
  846. }
  847. type clusterSumReqResp {
  848. PodSum int `json:"podSum,omitempty"`
  849. VmSum int `json:"vmSum,omitempty"`
  850. AdapterSum int `json:"AdapterSum,omitempty"`
  851. TaskSum int `json:"TaskSum,omitempty"`
  852. }
  853. type ClusterRelationInfo {
  854. Id string `json:"id,omitempty" db:"id"`
  855. Name string `json:"name,omitempty" db:"name"`
  856. Type string `json:"type,omitempty" db:"type"`
  857. Nickname string `json:"nickname,omitempty" db:"nickname"`
  858. Version string `json:"version,omitempty" db:"version"`
  859. Server string `json:"server,omitempty" db:"server"`
  860. CreateTime string `json:"createTime,omitempty" db:"create_time" gorm:"autoCreateTime"`
  861. CId string `json:"cId,omitempty" db:"id"`
  862. CAdapterId string `json:"cAdapterId,omitempty" db:"adapter_id"`
  863. CName string `json:"cName,omitempty" db:"name"`
  864. CNickname string `json:"cNickname,omitempty" db:"nickname"`
  865. CDescription string `json:"cDescription,omitempty" db:"description"`
  866. CServer string `json:"cServer,omitempty" db:"server"`
  867. CMonitorServer string `json:"cMonitorServer,omitempty" db:"monitor_server"`
  868. CUsername string `json:"cUsername,omitempty" db:"username"`
  869. CPassword string `json:"cPassword,omitempty" db:"password"`
  870. CToken string `json:"cToken,omitempty" db:"token"`
  871. CAk string `json:"cAk,omitempty" db:"ak"`
  872. CSk string `json:"cSk,omitempty" db:"sk"`
  873. CRegion string `json:"cRegion,omitempty" db:"region"`
  874. CProjectId string `json:"cProjectId,omitempty" db:"project_id"`
  875. CVersion string `json:"cVersion,omitempty" db:"version"`
  876. CLabel string `json:"cLabel,omitempty" db:"label"`
  877. COwnerId string `json:"cOwnerId,omitempty" db:"owner_id"`
  878. CAuthType string `json:"cAuthType,omitempty" db:"auth_type"`
  879. CRegionDict string `json:"cRegionDict,omitempty" db:"-"`
  880. CProducerDict string `json:"cProducerDict,omitempty" db:"-"`
  881. CCreateTime string `json:"cCreateTime,omitempty" db:"created_time" gorm:"autoCreateTime"`
  882. }
  883. type (
  884. DictInfo {
  885. Id string `json:"id,omitempty"`
  886. DictName string `json:"dictName,omitempty"`
  887. DictCode string `json:"dictCode,omitempty"`
  888. Description string `json:"description,omitempty"`
  889. Type string `json:"type,omitempty" db:"type"`
  890. Status string `json:"status,omitempty" db:"status"`
  891. CreateTime string `json:"createTime,omitempty" db:"created_time" gorm:"autoCreateTime"`
  892. }
  893. DictReq {
  894. Id string `form:"id,optional"`
  895. DictName string `form:"dictName,optional"`
  896. DictCode string `form:"dictCode,optional"`
  897. Description string `form:"description,optional"`
  898. Type string `form:"type,optional"`
  899. Status string `form:"status,optional"`
  900. PageInfo
  901. }
  902. DictEditReq {
  903. Id string `json:"id,optional"`
  904. DictName string `json:"dictName,optional"`
  905. DictCode string `json:"dictCode,optional"`
  906. Description string `json:"description,optional"`
  907. Type string `json:"type,optional"`
  908. Status string `json:"status,optional"`
  909. }
  910. DictResp {
  911. Id string `json:"id,omitempty"`
  912. DictName string `json:"dictName,omitempty"`
  913. DictCode string `json:"dictCode,omitempty"`
  914. Description string `json:"description,omitempty"`
  915. Type string `json:"type,omitempty"`
  916. Status string `json:"status,omitempty"`
  917. CreateTime string `json:"createTime,omitempty" db:"created_time" gorm:"autoCreateTime"`
  918. DictItemInfo []*DictItemInfo `json:"dictItemInfo,omitempty"`
  919. }
  920. Dicts {
  921. List []DictInfo `json:"list,omitempty"`
  922. }
  923. DictItemInfo {
  924. Id string `json:"id,omitempty"`
  925. DictId string `json:"dictId,omitempty"`
  926. ItemText string `json:"itemText,omitempty"`
  927. ItemValue string `json:"itemValue,omitempty"`
  928. Description string `json:"description,omitempty"`
  929. SortOrder string `json:"sortOrder,omitempty"`
  930. ParentId string `json:"parentId,omitempty"`
  931. Status string `json:"status,omitempty" db:"status"`
  932. CreateTime string `json:"createTime,omitempty" db:"created_time" gorm:"autoCreateTime"`
  933. Children []DictItemInfo `json:"children,omitempty" gorm:"-"`
  934. }
  935. DictItemReq {
  936. Id string `form:"id,optional"`
  937. DictId string `form:"dictId,optional"`
  938. ItemText string `form:"itemText,optional"`
  939. ItemValue string `form:"itemValue,optional"`
  940. Description string `form:"description,optional"`
  941. SortOrder string `form:"sortOrder,optional"`
  942. Type string `form:"type,optional"`
  943. ParentId string `form:"parentId,optional"`
  944. Status string `form:"status,optional"`
  945. }
  946. DictItemEditReq {
  947. Id string `json:"id,optional"`
  948. DictId string `json:"dictId,optional"`
  949. ItemText string `json:"itemText,optional"`
  950. ItemValue string `json:"itemValue,optional"`
  951. Description string `json:"description,optional"`
  952. SortOrder string `json:"sortOrder,optional"`
  953. ParentId string `json:"parentId,optional"`
  954. Status string `json:"status,optional"`
  955. }
  956. DictItemResp {
  957. Id string `json:"id,omitempty"`
  958. DictId string `json:"dictId,omitempty"`
  959. ItemText string `json:"itemText,omitempty"`
  960. ItemValue string `json:"itemValue,omitempty"`
  961. Description string `json:"description,omitempty"`
  962. SortOrder string `json:"sortOrder,omitempty"`
  963. ParentId string `json:"parentId,omitempty"`
  964. Status string `json:"status,omitempty"`
  965. CreateTime string `json:"createTime,omitempty" db:"created_time" gorm:"autoCreateTime"`
  966. DictInfo *DictInfo `json:"dictInfo,omitempty"`
  967. }
  968. DictItems {
  969. List []DictItemInfo `json:"list,omitempty"`
  970. }
  971. DictCodeReq {
  972. DictCode string `path:"dictCode"`
  973. }
  974. )
  975. type (
  976. CId {
  977. Id string `path:"id":"id,omitempty" validate:"required"`
  978. }
  979. CIds {
  980. Ids []string `json:"ids,omitempty" validate:"required"`
  981. }
  982. FId {
  983. Id string `form:"id":"id,omitempty" validate:"required"`
  984. }
  985. )
  986. type (
  987. PageInfo {
  988. PageNum int `form:"pageNum"`
  989. PageSize int `form:"pageSize"`
  990. }
  991. PageResult {
  992. List interface{} `json:"list,omitempty"`
  993. Total int64 `json:"total,omitempty"`
  994. PageNum int `json:"pageNum,omitempty"`
  995. PageSize int `json:"pageSize,omitempty"`
  996. }
  997. ListResult{
  998. List interface{} `json:"list,omitempty"`
  999. }
  1000. )
  1001. type (
  1002. HpcInfo {
  1003. Id int64 `json:"id"` // id
  1004. TaskId int64 `json:"task_id"` // 任务id
  1005. JobId string `json:"job_id"` // 作业id(在第三方系统中的作业id)
  1006. AdapterId int64 `json:"adapter_id"` // 执行任务的适配器id
  1007. ClusterId int64 `json:"cluster_id"` // 执行任务的集群id
  1008. ClusterType string `json:"cluster_type"` // 执行任务的集群类型
  1009. Name string `json:"name"` // 名称
  1010. Status string `json:"status"` // 状态
  1011. CmdScript string `json:"cmd_script"`
  1012. StartTime string `json:"start_time"` // 开始时间
  1013. RunningTime int64 `json:"running_time"` // 运行时间
  1014. DerivedEs string `json:"derived_es"`
  1015. Cluster string `json:"cluster"`
  1016. BlockId int64 `json:"block_id"`
  1017. AllocNodes int64 `json:"alloc_nodes"`
  1018. AllocCpu int64 `json:"alloc_cpu"`
  1019. CardCount int64 `json:"card_count"` // 卡数
  1020. Version string `json:"version"`
  1021. Account string `json:"account"`
  1022. WorkDir string `json:"work_dir"` // 工作路径
  1023. AssocId int64 `json:"assoc_id"`
  1024. ExitCode int64 `json:"exit_code"`
  1025. WallTime string `json:"wall_time"` // 最大运行时间
  1026. Result string `json:"result"` // 运行结果
  1027. DeletedAt string `json:"deleted_at"` // 删除时间
  1028. YamlString string `json:"yaml_string"`
  1029. AppType string `json:"app_type"` // 应用类型
  1030. AppName string `json:"app_name"` // 应用名称
  1031. Queue string `json:"queue"` // 队列名称
  1032. SubmitType string `json:"submit_type"` // cmd(命令行模式)
  1033. NNode string `json:"n_node"` // 节点个数(当指定该参数时,GAP_NODE_STRING必须为"")
  1034. StdOutFile string `json:"std_out_file"` // 工作路径/std.err.%j
  1035. StdErrFile string `json:"std_err_file"` // 工作路径/std.err.%j
  1036. StdInput string `json:"std_input"`
  1037. Environment string `json:"environment"`
  1038. DeletedFlag int64 `json:"deleted_flag"` // 是否删除(0-否,1-是)
  1039. CreatedBy int64 `json:"created_by"` // 创建人
  1040. CreateTime string `json:"created_time"` // 创建时间
  1041. UpdatedBy int64 `json:"updated_by"` // 更新人
  1042. UpdateTime string `json:"updated_time"` // 更新时间
  1043. }
  1044. CloudInfo {
  1045. Participant int64 `json:"participant,omitempty"`
  1046. Id int64 `json:"id,omitempty"`
  1047. TaskId int64 `json:"taskId,omitempty"`
  1048. ApiVersion string `json:"apiVersion,omitempty"`
  1049. Kind string `json:"kind,omitempty"`
  1050. Namespace string `json:"namespace,omitempty"`
  1051. Name string `json:"name,omitempty"`
  1052. Status string `json:"status,omitempty"`
  1053. StartTime string `json:"startTime,omitempty"`
  1054. RunningTime int64 `json:"runningTime,omitempty"`
  1055. Result string `json:"result,omitempty"`
  1056. YamlString string `json:"yamlString,omitempty"`
  1057. }
  1058. AiInfo {
  1059. ParticipantId int64 `json:"participantId,omitempty"`
  1060. TaskId int64 `json:"taskId,omitempty"`
  1061. ProjectId string `json:"project_id,omitempty"`
  1062. Name string `json:"name,omitempty"`
  1063. Status string `json:"status,omitempty"`
  1064. StartTime string `json:"startTime,omitempty"`
  1065. RunningTime int64 `json:"runningTime,omitempty"`
  1066. Result string `json:"result,omitempty"`
  1067. JobId string `json:"jobId,omitempty"`
  1068. CreateTime string `json:"createTime,omitempty"`
  1069. ImageUrl string `json:"imageUrl,omitempty"`
  1070. Command string `json:"command,omitempty"`
  1071. FlavorId string `json:"flavorId,omitempty"`
  1072. SubscriptionId string `json:"subscriptionId,omitempty"`
  1073. ItemVersionId string `json:"itemVersionId,omitempty"`
  1074. }
  1075. VmInfo {
  1076. ParticipantId int64 `json:"participantId,omitempty"`
  1077. TaskId int64 `json:"taskId,omitempty"`
  1078. Name string `json:"name,omitempty"`
  1079. FlavorRef string `json:"flavor_ref,omitempty"`
  1080. ImageRef string `json:"image_ref,omitempty"`
  1081. NetworkUuid string `json:"network_uuid,omitempty"`
  1082. BlockUuid string `json:"block_uuid,omitempty"`
  1083. SourceType string `json:"source_type,omitempty"`
  1084. DeleteOnTermination bool `json:"delete_on_termination,omitempty"`
  1085. Status string `json:"status,omitempty"`
  1086. MinCount string `json:"min_count,omitempty"`
  1087. Platform string `json:"platform,omitempty"`
  1088. Uuid string `json:"uuid,omitempty"`
  1089. }
  1090. )
  1091. type (
  1092. PullTaskInfoReq {
  1093. AdapterId int64 `form:"adapterId"`
  1094. }
  1095. PullTaskInfoResp {
  1096. HpcInfoList []*HpcInfo `json:"HpcInfoList,omitempty"`
  1097. CloudInfoList []*CloudInfo `json:"CloudInfoList,omitempty"`
  1098. AiInfoList []*AiInfo `json:"AiInfoList,omitempty"`
  1099. VmInfoList []*VmInfo `json:"VmInfoList,omitempty"`
  1100. }
  1101. )
  1102. type (
  1103. PushTaskInfoReq {
  1104. AdapterId int64 `json:"adapterId"`
  1105. HpcInfoList []*HpcInfo `json:"hpcInfoList"`
  1106. CloudInfoList []*CloudInfo `json:"cloudInfoList"`
  1107. AiInfoList []*AiInfo `json:"aiInfoList"`
  1108. VmInfoList []*VmInfo `json:"vmInfoList"`
  1109. }
  1110. PushTaskInfoResp {
  1111. Code int64 `json:"code"`
  1112. Msg string `json:"msg"`
  1113. }
  1114. )
  1115. type (
  1116. PushResourceInfoReq {
  1117. AdapterId int64 `json:"adapterId"`
  1118. ResourceStats []ResourceStats `json:"resourceStats"`
  1119. }
  1120. PushResourceInfoResp {
  1121. Code int64 `json:"code"`
  1122. Msg string `json:"msg"`
  1123. }
  1124. )
  1125. type (
  1126. NoticeInfo {
  1127. AdapterId int64 `json:"adapterId"`
  1128. AdapterName string `json:"adapterName"`
  1129. ClusterId int64 `json:"clusterId"`
  1130. ClusterName string `json:"clusterName"`
  1131. NoticeType string `json:"noticeType"`
  1132. TaskName string `json:"taskName"`
  1133. Incident string `json:"incident"`
  1134. }
  1135. ListNoticeReq struct{}
  1136. ListNoticeResp {
  1137. Code int64 `json:"code"`
  1138. Msg string `json:"msg"`
  1139. Data []NoticeInfo `json:"data"`
  1140. }
  1141. PushNoticeReq {
  1142. NoticeInfo NoticeInfo `json:"noticeInfo"`
  1143. }
  1144. PushNoticeResp {
  1145. Code int64 `json:"code"`
  1146. Msg string `json:"msg"`
  1147. }
  1148. )
  1149. type ResourceStats {
  1150. ClusterId int64 `json:"clusterId"`
  1151. Name string `json:"name"`
  1152. CpuCoreAvail int64 `json:"cpuCoreAvail"`
  1153. CpuCoreTotal int64 `json:"cpuCoreTotal"`
  1154. MemAvail float64 `json:"memAvail"`
  1155. MemTotal float64 `json:"memTotal"`
  1156. DiskAvail float64 `json:"diskAvail"`
  1157. DiskTotal float64 `json:"diskTotal"`
  1158. GpuAvail int64 `json:"gpuAvail"`
  1159. CardsAvail []*Card `json:"cardsAvail"`
  1160. CpuCoreHours float64 `json:"cpuCoreHours"`
  1161. Balance float64 `json:"balance"`
  1162. }
  1163. type Card {
  1164. Platform string `json:"platform"`
  1165. Type string `json:"type"`
  1166. Name string `json:"name"`
  1167. TOpsAtFp16 float64 `json:"TOpsAtFp16"`
  1168. CardHours float64 `json:"cardHours"`
  1169. CardNum int32 `json:"cardNum"`
  1170. }
  1171. type TaskStatusResp {
  1172. Succeeded int `json:"Succeeded"`
  1173. Failed int `json:"Failed"`
  1174. Running int `json:"Running"`
  1175. Saved int `json:"Saved"`
  1176. }
  1177. type (
  1178. TaskDetailsResp {
  1179. Name string `json:"name"`
  1180. description string `json:"description"`
  1181. StartTime string `json:"startTime"`
  1182. EndTime string `json:"endTime"`
  1183. Strategy int64 `json:"strategy"`
  1184. SynergyStatus int64 `json:"synergyStatus"`
  1185. ClusterInfos []*ClusterInfo `json:"clusterInfos"`
  1186. SubTaskInfos []*SubTaskInfo `json:"subTaskInfos"`
  1187. TaskTypeDict string `json:"taskTypeDict"`
  1188. AdapterTypeDict string `json:"adapterTypeDict"`
  1189. }
  1190. SubTaskInfo{
  1191. Id string `json:"id" db:"id"`
  1192. Name string `json:"name" db:"name"`
  1193. ClusterId string `json:"clusterId" db:"cluster_id"`
  1194. ClusterName string `json:"clusterName" db:"cluster_name"`
  1195. Status string `json:"status" db:"status"`
  1196. Remark string `json:"remark" db:"remark"`
  1197. InferUrl string `json:"inferUrl"`
  1198. }
  1199. )
  1200. type (
  1201. CommonResp {
  1202. Code int `json:"code,omitempty"`
  1203. Msg string `json:"msg,omitempty"`
  1204. Data interface{} `json:"data,omitempty"`
  1205. }
  1206. )

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.