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

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

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.