gets the current status for the cluster :param pid: :param broker: an optional broker instance :param cluster_id: id of the cluster :return: Stat or Status
(pid: int, cluster_id: str, broker: Broker = None)
| 79 | |
| 80 | @staticmethod |
| 81 | def get(pid: int, cluster_id: str, broker: Broker = None) -> Union[Status, None]: |
| 82 | """ |
| 83 | gets the current status for the cluster |
| 84 | :param pid: |
| 85 | :param broker: an optional broker instance |
| 86 | :param cluster_id: id of the cluster |
| 87 | :return: Stat or Status |
| 88 | """ |
| 89 | if not broker: |
| 90 | broker = get_broker() |
| 91 | pack = broker.get_stat(Stat.get_key(cluster_id)) |
| 92 | if pack: |
| 93 | try: |
| 94 | return SignedPackage.loads(pack) |
| 95 | except BadSignature: |
| 96 | return None |
| 97 | return Status(pid=pid, cluster_id=cluster_id) |
| 98 | |
| 99 | @staticmethod |
| 100 | def get_all(broker: Broker = None) -> list: |