+ return forward_cps
+
+ def _get_policies_scaling(self, top_policies):
+ policies_scaling = []
+ scaling_policies = self.get_scaling_policies(top_policies)
+ if len(scaling_policies) > 0:
+ policies_scaling.append({"scaling": scaling_policies})
+ return policies_scaling
+
+ def get_policies_by_keyword(self, top_policies, keyword):
+ ret = []
+ for policy in top_policies:
+ if policy.type.upper().find(keyword) >= 0:
+ tmp = {}
+ tmp['policy_id'] = policy.name
+ tmp['description'] = policy.description
+ if 'properties' in policy.entity_tpl:
+ tmp['properties'] = policy.entity_tpl['properties']
+ tmp['targets'] = policy.targets
+ ret.append(tmp)
+
+ return ret
+
+ def get_scaling_policies(self, top_policies):
+ return self.get_policies_by_keyword(top_policies, '.SCALING')
+
+ def get_all_flavour(self, groups):
+ rets = []
+ for group in groups:
+ if self._isFlavour(group):
+ ret = {}
+ ret['flavour_id'] = group.name
+ ret['description'] = group.description
+ if 'properties' in group.tpl:
+ ret['properties'] = group.tpl['properties']
+ ret['members'] = group.members
+
+ rets.append(ret)
+ return rets
+
+ def _isFlavour(self, group):
+ return group.type.upper().find('FLAVOUR') >= 0