vnf_monitoring_param = next(
filter(
lambda param: param['id'] == scaling_criteria[
- 'vnf-monitoring-param-ref'],
+ 'vnf-monitoring-param-ref'
+ ],
vnf_monitoring_params)
)
- if not vdu_ref['vdu-id-ref'] == vnf_monitoring_param['vdu-ref']:
+ if vdu_ref['vdu-id-ref'] != vnf_monitoring_param['vdu-monitoring-param'][
+ 'vdu-ref'
+ ]:
continue
vdu = next(
filter(lambda vdu: vdu['id'] == vdu_ref['vdu-id-ref'], vnfd['vdu'])
vdu_monitoring_param = next(
filter(
lambda param: param['id'] == vnf_monitoring_param[
- 'vdu-monitoring-param-ref'],
+ 'vdu-monitoring-param'
+ ][
+ 'vdu-monitoring-param-ref'
+ ],
vdu_monitoring_params))
vdurs = list(
- filter(lambda vdur: vdur['vdu-id-ref'] == vnf_monitoring_param['vdu-ref'],
- vnfr['vdur']))
+ filter(lambda vdur: vdur['vdu-id-ref'] == vnf_monitoring_param[
+ 'vdu-monitoring-param'
+ ][
+ 'vdu-ref'
+ ], vnfr['vdur']))
for vdur in vdurs:
try:
(ScalingAlarm.select()
db.connect()
db.create_tables([ScalingGroup, ScalingPolicy, ScalingCriteria, ScalingAlarm])
db.close()
- except Exception as e:
+ except Exception:
log.exception("Error creating tables: ")
"id": "cirros_vnf_memory_util",
"name": "cirros_vnf_memory_util",
"aggregation-type": "AVERAGE",
- "vdu-monitoring-param-ref": "cirros_vnfd-VM_memory_util",
- "vdu-ref": "cirros_vnfd-VM"
+ "vdu-monitoring-param": {
+ "vdu-monitoring-param-ref": "cirros_vnfd-VM_memory_util",
+ "vdu-ref": "cirros_vnfd-VM"
+ }
+ },
+ {
+ "id": "haproxy_users",
+ "name": "haproxy_users",
+ "aggregation-type": "AVERAGE",
+ "vnf-metric":
+ {"vnf-metric-name-ref": "users"}
}
],
+ "vdu-configuration": {
+ "juju": {
+ "charm": "testmetrics",
+ "proxy": True
+ },
+ "metrics": {
+ "name": "users"
+ }
+ },
"description": "Simple VNF example with a cirros and a scaling group descriptor",
"id": "cirros_vdu_scaling_vnf",
"logo": "cirros-64.png",