+ self.model.add_observer(
+ callable_, 'unit', 'add', self._unit_match_pattern)
+
+ def on_unit_remove(self, callable_):
+ """Add a "unit removed" observer to this entity, which will be called
+ whenever a unit is removed from this application.
+
+ """
+ self.model.add_observer(
+ callable_, 'unit', 'remove', self._unit_match_pattern)
+
+ @property
+ def units(self):
+ return [
+ unit for unit in self.model.units.values()
+ if unit.application == self.name
+ ]
+
+ @property
+ def status(self):
+ """Get the application status, as set by the charm's leader.
+
+ """
+ return self.data['status']['current']
+
+ @property
+ def status_message(self):
+ """Get the application status message, as set by the charm's leader.
+
+ """
+ return self.data['status']['message']
+
+ async def add_relation(self, local_relation, remote_relation):
+ """Add a relation to another application.
+
+ :param str local_relation: Name of relation on this application
+ :param str remote_relation: Name of relation on the other
+ application in the form '<application>[:<relation_name>]'