types.go 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. package proxmox
  2. type singleResponse[T any] struct {
  3. Data T `json:"data"`
  4. }
  5. type multipleResponse[T any] struct {
  6. Data []T `json:"data"`
  7. }
  8. type ClusterResource struct {
  9. NetOut int64 `json:"netout"`
  10. Name string `json:"name"`
  11. Status string `json:"status"`
  12. NetIn int64 `json:"netin"`
  13. MaxCPU int `json:"maxcpu"`
  14. DiskWrite int64 `json:"diskwrite"`
  15. Template int `json:"template"`
  16. CPU float64 `json:"cpu"`
  17. Uptime int64 `json:"uptime"`
  18. Mem int64 `json:"mem"`
  19. DiskRead int64 `json:"diskread"`
  20. MaxMem int64 `json:"maxmem"`
  21. MaxDisk uint64 `json:"maxdisk"`
  22. ID string `json:"id"`
  23. VMID int `json:"vmid"`
  24. Type string `json:"type"`
  25. Node string `json:"node"`
  26. Disk uint64 `json:"disk"`
  27. Level string `json:"level"`
  28. CgroupMode int `json:"cgroup-mode"`
  29. PluginType string `json:"plugintype"`
  30. Content string `json:"content"`
  31. Shared int `json:"shared"`
  32. Storage string `json:"storage"`
  33. SDN string `json:"sdn"`
  34. }
  35. type NodeStatus struct {
  36. PveVersion string `json:"pveversion"`
  37. Kversion string `json:"kversion"`
  38. Wait float64 `json:"wait"`
  39. Uptime int64 `json:"uptime"`
  40. LoadAvg []string `json:"loadavg"`
  41. Cpu float64 `json:"cpu"`
  42. Idle int `json:"idle"`
  43. Swap struct {
  44. Free uint64 `json:"free"`
  45. Used uint64 `json:"used"`
  46. Total uint64 `json:"total"`
  47. } `json:"swap"`
  48. CpuInfo struct {
  49. Model string `json:"model"`
  50. Cpus int `json:"cpus"`
  51. Hvm string `json:"hvm"`
  52. UserHz int `json:"user_hz"`
  53. Flags string `json:"flags"`
  54. Cores int `json:"cores"`
  55. Sockets int `json:"sockets"`
  56. Mhz string `json:"mhz"`
  57. } `json:"cpuinfo"`
  58. Memory struct {
  59. Free uint64 `json:"free"`
  60. Used uint64 `json:"used"`
  61. Total uint64 `json:"total"`
  62. } `json:"memory"`
  63. RootFs struct {
  64. Available int64 `json:"avail"`
  65. Total int64 `json:"total"`
  66. Used int64 `json:"used"`
  67. Free int64 `json:"free"`
  68. } `json:"rootfs"`
  69. }