status.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. from enum import IntEnum
  4. __author__ = 'James Iter'
  5. __date__ = '2017/3/22'
  6. __contact__ = 'james.iter.cn@gmail.com'
  7. __copyright__ = '(c) 2017 by James Iter.'
  8. class JimVEdition(IntEnum):
  9. standalone = 0
  10. hyper_convergence = 1
  11. class StorageMode(IntEnum):
  12. local = 0
  13. shared_mount = 1
  14. ceph = 2
  15. glusterfs = 3
  16. class EmitKind(IntEnum):
  17. log = 0
  18. guest_event = 1
  19. host_event = 2
  20. response = 3
  21. guest_collection_performance = 4
  22. host_collection_performance = 5
  23. class GuestState(IntEnum):
  24. # 参考地址:
  25. # http://libvirt.org/docs/libvirt-appdev-guide-python/en-US/html/libvirt_application_development_guide_using_python-Guest_Domains-Information-State.html
  26. no_state = 0
  27. booting = 1
  28. running = 2
  29. blocked = 3
  30. paused = 4
  31. shutdown = 5
  32. shutoff = 6
  33. crashed = 7
  34. pm_suspended = 8
  35. migrating = 9
  36. update = 10
  37. creating = 11
  38. snapshot_converting = 12
  39. dirty = 255
  40. class HostEvent(IntEnum):
  41. heartbeat = 0
  42. class LogLevel(IntEnum):
  43. critical = 0
  44. error = 1
  45. warn = 2
  46. info = 3
  47. debug = 4
  48. class ResponseState(IntEnum):
  49. success = True
  50. failure = False
  51. class DiskState(IntEnum):
  52. pending = 0
  53. idle = 1
  54. mounted = 2
  55. mounting = 3
  56. unloading = 4
  57. dirty = 255
  58. class BootJobUseFor(IntEnum):
  59. # 用于系统模板初始化
  60. template = 0
  61. # 用于系统及,比如通过重启系统更改密码功能之类
  62. system = 1
  63. # 用于用户自定义
  64. user = 2
  65. class OSTemplateInitializeOperateKind(IntEnum):
  66. cmd = 0
  67. write_file = 1
  68. append_file = 2
  69. class OSTemplateImageKind(IntEnum):
  70. public = 0
  71. custom = 1
  72. class GuestCollectionPerformanceDataKind(IntEnum):
  73. cpu_memory = 0
  74. traffic = 1
  75. disk_io = 2
  76. class HostCollectionPerformanceDataKind(IntEnum):
  77. cpu_memory = 0
  78. traffic = 1
  79. disk_usage_io = 2