diff --git a/juju/application.py b/juju/application.py index 3a80f23f..24b84386 100644 --- a/juju/application.py +++ b/juju/application.py @@ -4,7 +4,8 @@ import hashlib import json import logging -import typing +import warnings +from typing import Dict, List, Union from pathlib import Path from . import jasyncio, model, tag, utils @@ -24,6 +25,42 @@ class Application(model.ModelEntity): + @property + def name(self) -> str: + return self.safe_data["name"] + + @property + def exposed(self) -> bool: + return self.safe_data["exposed"] + + @property + def owner_tag(self) -> str: + warnings.warn("Deprecated", DeprecationWarning) + return self.safe_data["owner-tag"] + + @property + def life(self) -> str: + return self.safe_data["life"] + + @property + def min_units(self) -> int: + warnings.warn("Deprecated", DeprecationWarning) + return self.safe_data["min-units"] + + @property + def constraints(self) -> Dict[str, Union[str, int, bool]]: + return self.safe_data["constraints"] + + @property + def subordinate(self) -> bool: + warnings.warn("Deprecated", DeprecationWarning) + return self.safe_data["subordinate"] + + @property + def workload_version(self) -> str: + warnings.warn("Deprecated, use Unit.workload_version instead", DeprecationWarning) + return self.safe_data["workload-version"] + @property def _unit_match_pattern(self): return r'^{}.*$'.format(self.entity_id) @@ -63,7 +100,7 @@ def subordinate_units(self): return [u for u in self.units if u.is_subordinate] @property - def relations(self) -> typing.List[Relation]: + def relations(self) -> List[Relation]: return [rel for rel in self.model.relations if rel.matches(self.name)] def related_applications(self, endpoint_name=None):