+ 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.safe_data['status']['current']
+
+ @property
+ def status_message(self):
+ """Get the application status message, as set by the charm's leader.
+
+ """
+ return self.safe_data['status']['message']
+
+ @property
+ def tag(self):
+ return 'application-%s' % self.name
+
+ 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>]'
+
+ """
+ if ':' not in local_relation:
+ local_relation = '{}:{}'.format(self.name, local_relation)
+
+ return await self.model.add_relation(local_relation, remote_relation)
+
+ async def add_unit(self, count=1, to=None):
+ """Add one or more units to this application.