status.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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 DFS(IntEnum):
  12. ceph = 0
  13. glusterfs = 1
  14. class EmitKind(IntEnum):
  15. log = 0
  16. guest_event = 1
  17. host_event = 2
  18. response = 3
  19. collection_performance = 4
  20. host_collection_performance = 5
  21. class GuestState(IntEnum):
  22. # 参考地址:
  23. # http://libvirt.org/docs/libvirt-appdev-guide-python/en-US/html/libvirt_application_development_guide_using_python-Guest_Domains-Information-State.html
  24. no_state = 0
  25. running = 1
  26. blocked = 2
  27. paused = 3
  28. shutdown = 4
  29. shutoff = 5
  30. crashed = 6
  31. pm_suspended = 7
  32. migrating = 8
  33. update = 9
  34. dirty = 255
  35. class HostEvent(IntEnum):
  36. heartbeat = 0
  37. class LogLevel(IntEnum):
  38. critical = 0
  39. error = 1
  40. warn = 2
  41. info = 3
  42. debug = 4
  43. class ResponseState(IntEnum):
  44. success = True
  45. failure = False
  46. class DiskState(IntEnum):
  47. pending = 0
  48. idle = 1
  49. mounted = 2
  50. mounting = 3
  51. unloading = 4
  52. dirty = 255
  53. class BootJobUseFor(IntEnum):
  54. # 用于系统模板初始化
  55. template = 0
  56. # 用于系统及,比如通过重启系统更改密码功能之类
  57. system = 1
  58. # 用于用户自定义
  59. user = 2
  60. class OperateRuleKind(IntEnum):
  61. cmd = 0
  62. write_file = 1
  63. append_file = 2
  64. class CollectionPerformanceDataKind(IntEnum):
  65. cpu_memory = 0
  66. traffic = 1
  67. disk_io = 2
  68. class HostCollectionPerformanceDataKind(IntEnum):
  69. cpu_memory = 0
  70. traffic = 1
  71. disk_usage_io = 2