]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/services/cluster.py
import ceph 16.2.7
[ceph.git] / ceph / src / pybind / mgr / dashboard / services / cluster.py
1 # -*- coding: utf-8 -*-
2 from enum import Enum
3
4 from .. import mgr
5
6
7 class ClusterModel:
8
9 class Status(Enum):
10 INSTALLED = 0
11 POST_INSTALLED = 1
12
13 status: Status
14
15 def __init__(self, status=Status.INSTALLED.name):
16 self.status = self.Status[status]
17
18 def dict(self):
19 return {'status': self.status.name}
20
21 def to_db(self):
22 mgr.set_store('cluster/status', self.status.name)
23
24 @classmethod
25 def from_db(cls):
26 return cls(status=mgr.get_store('cluster/status', cls.Status.INSTALLED.name))