status.py 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. running = 1
  28. blocked = 2
  29. paused = 3
  30. shutdown = 4
  31. shutoff = 5
  32. crashed = 6
  33. pm_suspended = 7
  34. migrating = 8
  35. update = 9
  36. creating = 10
  37. dirty = 255
  38. class HostEvent(IntEnum):
  39. heartbeat = 0
  40. class LogLevel(IntEnum):
  41. critical = 0
  42. error = 1
  43. warn = 2
  44. info = 3
  45. debug = 4
  46. class ResponseState(IntEnum):
  47. success = True
  48. failure = False
  49. class DiskState(IntEnum):
  50. pending = 0
  51. idle = 1
  52. mounted = 2
  53. mounting = 3
  54. unloading = 4
  55. dirty = 255
  56. class BootJobUseFor(IntEnum):
  57. # 用于系统模板初始化
  58. template = 0
  59. # 用于系统及,比如通过重启系统更改密码功能之类
  60. system = 1
  61. # 用于用户自定义
  62. user = 2
  63. class OperateRuleKind(IntEnum):
  64. cmd = 0
  65. write_file = 1
  66. append_file = 2
  67. class OSTemplateInitializeOperateKind(IntEnum):
  68. cmd = 0
  69. write_file = 1
  70. append_file = 2
  71. class GuestCollectionPerformanceDataKind(IntEnum):
  72. cpu_memory = 0
  73. traffic = 1
  74. disk_io = 2
  75. class HostCollectionPerformanceDataKind(IntEnum):
  76. cpu_memory = 0
  77. traffic = 1
  78. disk_usage_io = 2
  79. class OSType(IntEnum):
  80. linux = 0
  81. windows = 1
  82. bsd = 2
  83. aix = 3
  84. hp_unix = 4
  85. unknown = 255