From 6a93e0d68bf3bc3f41328b2b8063c65722bc98b5 Mon Sep 17 00:00:00 2001 From: Tim Van Steenburgh Date: Tue, 20 Dec 2016 10:23:09 -0500 Subject: [PATCH] Docs --- docs/narrative/application.rst | 1 + docs/narrative/controller.rst | 2 ++ docs/narrative/model.rst | 2 ++ docs/narrative/unit.rst | 2 ++ juju/application.py | 5 +++++ juju/model.py | 2 ++ juju/unit.py | 5 +++++ 7 files changed, 19 insertions(+) diff --git a/docs/narrative/application.rst b/docs/narrative/application.rst index 044807d..01d5bc0 100644 --- a/docs/narrative/application.rst +++ b/docs/narrative/application.rst @@ -1,5 +1,6 @@ Applications ============ +For api docs, see :class:`juju.application.Application`. Deploying diff --git a/docs/narrative/controller.rst b/docs/narrative/controller.rst index c6f4e0a..2da0e7b 100644 --- a/docs/narrative/controller.rst +++ b/docs/narrative/controller.rst @@ -8,6 +8,8 @@ Connecting to the controller endpoint is useful if you want to programmatically 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 ------------------------------------ diff --git a/docs/narrative/model.rst b/docs/narrative/model.rst index c27179d..6811eac 100644 --- a/docs/narrative/model.rst +++ b/docs/narrative/model.rst @@ -4,6 +4,8 @@ A Juju controller provides websocket endpoints for each of its 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 ------------------------------- diff --git a/docs/narrative/unit.rst b/docs/narrative/unit.rst index d7da412..5d6b48d 100644 --- a/docs/narrative/unit.rst +++ b/docs/narrative/unit.rst @@ -1,5 +1,7 @@ Units ===== +For api docs, see :class:`juju.unit.Unit`. + Running Commands ---------------- diff --git a/juju/application.py b/juju/application.py index 55b9d1e..dc615fd 100644 --- a/juju/application.py +++ b/juju/application.py @@ -344,4 +344,9 @@ class Application(model.ModelEntity): 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) diff --git a/juju/model.py b/juju/model.py index 4a8bc03..a0180a0 100644 --- a/juju/model.py +++ b/juju/model.py @@ -1264,6 +1264,8 @@ class Model(object): :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") diff --git a/juju/unit.py b/juju/unit.py index 9a75404..0145913 100644 --- a/juju/unit.py +++ b/juju/unit.py @@ -240,5 +240,10 @@ class Unit(model.ModelEntity): 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] -- 2.25.1