"""Get the application status, as set by the charm's leader.
"""
- return self.data['status']['current']
+ 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.data['status']['message']
+ 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.
result = await app_facade.AddUnits(
application=self.name,
- placement=[parse_placement(to)],
+ placement=[parse_placement(to)] if to else None,
num_units=count,
)
"""
pass
+
+ async def get_metrics(self):
+ return await self.model.get_metrics(self.tag)