projects
/
osm
/
N2VC.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix sphinx parsing errors
[osm/N2VC.git]
/
juju
/
application.py
diff --git
a/juju/application.py
b/juju/application.py
index
4a98622
..
74f9057
100644
(file)
--- a/
juju/application.py
+++ b/
juju/application.py
@@
-3,6
+3,7
@@
import logging
from . import model
from .client import client
from . import model
from .client import client
+from .placement import parse as parse_placement
log = logging.getLogger(__name__)
log = logging.getLogger(__name__)
@@
-49,6
+50,10
@@
class Application(model.ModelEntity):
"""
return self.data['status']['message']
"""
return self.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.
async def add_relation(self, local_relation, remote_relation):
"""Add a relation to another application.
@@
-83,7
+88,7
@@
class Application(model.ModelEntity):
result = await app_facade.AddUnits(
application=self.name,
result = await app_facade.AddUnits(
application=self.name,
- placement=
to
,
+ placement=
[parse_placement(to)] if to else None
,
num_units=count,
)
num_units=count,
)
@@
-337,3
+342,6
@@
class Application(model.ModelEntity):
"""
pass
"""
pass
+
+ async def get_metrics(self):
+ return await self.model.get_metrics(self.tag)