use ceilometer client network for URI
diff --git a/xos/ceilometer/models.py b/xos/ceilometer/models.py
index 809494d..ee5cbf9 100644
--- a/xos/ceilometer/models.py
+++ b/xos/ceilometer/models.py
@@ -61,8 +61,8 @@
addresses["private"] = (ns.ip, ns.mac)
elif "nat" in ns.network.name.lower():
addresses["nat"] = (ns.ip, ns.mac)
- elif "hpc_client" in ns.network.name.lower():
- addresses["hpc_client"] = (ns.ip, ns.mac)
+ elif "ceilometer_client_access" in ns.network.labels.lower():
+ addresses["ceilometer"] = (ns.ip, ns.mac)
return addresses
@property
@@ -70,6 +70,10 @@
return self.addresses.get("nat", (None, None))[0]
@property
+ def ceilometer_ip(self):
+ return self.addresses.get("ceilometer", (None, None))[0]
+
+ @property
def site_tenant_list(self):
tenant_ids = Set()
for sp in SitePrivilege.objects.filter(user=self.creator):
@@ -103,9 +107,9 @@
@property
def ceilometer_url(self):
- if not self.private_ip:
+ if not self.ceilometer_ip:
return None
- return "http://" + self.private_ip + "/uri/to/ceilometer/api/"
+ return "http://" + self.ceilometer_ip + "/uri/to/ceilometer/api/"
def model_policy_monitoring_channel(pk):
# TODO: this should be made in to a real model_policy
diff --git a/xos/tosca/samples/ceilometer.yaml b/xos/tosca/samples/ceilometer.yaml
index aeb4acb..9797d59 100644
--- a/xos/tosca/samples/ceilometer.yaml
+++ b/xos/tosca/samples/ceilometer.yaml
@@ -21,6 +21,22 @@
Private:
type: tosca.nodes.NetworkTemplate
+ ceilometer_network:
+ type: tosca.nodes.network.Network.XOS
+ properties:
+ ip_version: 4
+ labels: ceilometer_client_access
+ requirements:
+ - network_template:
+ node: Private
+ relationship: tosca.relationships.UsesNetworkTemplate
+ - owner:
+ node: mysite_ceilometer
+ relationship: tosca.relationships.MemberOfSlice
+ - connection:
+ node: mysite_ceilometer
+ relationship: tosca.relationships.ConnectsToSlice
+
mysite:
type: tosca.nodes.Site