snapshot.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import jimit as ji
  4. from filter import FilterFieldType
  5. from orm import ORM
  6. __author__ = 'James Iter'
  7. __date__ = '2018/4/10'
  8. __contact__ = 'james.iter.cn@gmail.com'
  9. __copyright__ = '(c) 2018 by James Iter.'
  10. class Snapshot(ORM):
  11. _table_name = 'snapshot'
  12. _primary_key = 'id'
  13. def __init__(self):
  14. super(Snapshot, self).__init__()
  15. self.id = 0
  16. self.label = None
  17. self.snapshot_id = None
  18. self.parent_id = None
  19. self.guest_uuid = None
  20. self.status = None
  21. self.progress = None
  22. self.create_time = ji.Common.tus()
  23. self.xml = None
  24. @staticmethod
  25. def get_filter_keywords():
  26. return {
  27. 'id': FilterFieldType.INT.value,
  28. 'label': FilterFieldType.STR.value,
  29. 'snapshot_id': FilterFieldType.STR.value,
  30. 'guest_uuid': FilterFieldType.STR.value,
  31. 'create_time': FilterFieldType.INT.value
  32. }
  33. @staticmethod
  34. def get_allow_update_keywords():
  35. return []
  36. @staticmethod
  37. def get_allow_content_search_keywords():
  38. return ['label', 'snapshot_id']