status.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. 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. dirty = 255
  37. class HostEvent(IntEnum):
  38. heartbeat = 0
  39. class LogLevel(IntEnum):
  40. critical = 0
  41. error = 1
  42. warn = 2
  43. info = 3
  44. debug = 4
  45. class ResponseState(IntEnum):
  46. success = True
  47. failure = False
  48. class DiskState(IntEnum):
  49. pending = 0
  50. idle = 1
  51. mounted = 2
  52. mounting = 3
  53. unloading = 4
  54. dirty = 255
  55. class BootJobUseFor(IntEnum):
  56. # 用于系统模板初始化
  57. template = 0
  58. # 用于系统及,比如通过重启系统更改密码功能之类
  59. system = 1
  60. # 用于用户自定义
  61. user = 2
  62. class OperateRuleKind(IntEnum):
  63. cmd = 0
  64. write_file = 1
  65. append_file = 2
  66. class CollectionPerformanceDataKind(IntEnum):
  67. cpu_memory = 0
  68. traffic = 1
  69. disk_io = 2
  70. class HostCollectionPerformanceDataKind(IntEnum):
  71. cpu_memory = 0
  72. traffic = 1
  73. disk_usage_io = 2