Applications
============
+For api docs, see :class:`juju.application.Application`.
Deploying
create a new model. If the model you want to use already exists, you can
connect directly to it (see :doc:`model`).
+For api docs, see :class:`juju.controller.Controller`.
+
Connecting to the Current Controller
------------------------------------
models. In order to do anything useful with a model, the juju lib must
connect to one of these endpoints. There are several ways to do this.
+For api docs, see :class:`juju.model.Model`.
+
Connecting to the Current Model
-------------------------------
Units
=====
+For api docs, see :class:`juju.unit.Unit`.
+
Running Commands
----------------
pass
async def get_metrics(self):
+ """Get metrics for this application's units.
+
+ :return: Dictionary of unit_name:metrics
+
+ """
return await self.model.get_metrics(self.tag)
:param str \*tags: Tags of entities from which to retrieve metrics.
No tags retrieves the metrics of all units in the model.
+ :return: Dictionary of unit_name:metrics
+
"""
log.debug("Retrieving metrics for %s",
', '.join(tags) if tags else "all units")
False)
async def get_metrics(self):
+ """Get metrics for the unit.
+
+ :return: Dictionary of metrics for this unit.
+
+ """
metrics = await self.model.get_metrics(self.tag)
return metrics[self.name]