import toscaparser
from toscaparser.utils import yamlparser
from toscaparser.tosca_template import ToscaTemplate
from translator.hot.tosca_translator import TOSCATranslator
from tacker.vm.tosca import utils as toscautils
vnfd_yaml = open("sample.yaml")
vnfd_dict = yamlparser.simple_ordered_parse(vnfd_yaml)
toscautils.updateimports(vnfd_dict)
tosca = ToscaTemplate(yaml_dict_tpl=vnfd_dict)
monitoring_dict = toscautils.get_vdu_monitoring(tosca)
mgmt_ports = toscautils.get_mgmt_ports(tosca)
res_tpl = toscautils.get_resources_dict(tosca)
toscautils.post_process_template(tosca)
translate = TOSCATranslator(tosca, {})
heat_template_yaml = translate.translate()
heat_template_yaml = toscautils.post_process_heat_template(heat_template_yaml, mgmt_ports, res_tpl)
print heat_template_yaml
from toscaparser.utils import yamlparser
from toscaparser.tosca_template import ToscaTemplate
from translator.hot.tosca_translator import TOSCATranslator
from tacker.vm.tosca import utils as toscautils
vnfd_yaml = open("sample.yaml")
vnfd_dict = yamlparser.simple_ordered_parse(vnfd_yaml)
toscautils.updateimports(vnfd_dict)
tosca = ToscaTemplate(yaml_dict_tpl=vnfd_dict)
monitoring_dict = toscautils.get_vdu_monitoring(tosca)
mgmt_ports = toscautils.get_mgmt_ports(tosca)
res_tpl = toscautils.get_resources_dict(tosca)
toscautils.post_process_template(tosca)
translate = TOSCATranslator(tosca, {})
heat_template_yaml = translate.translate()
heat_template_yaml = toscautils.post_process_heat_template(heat_template_yaml, mgmt_ports, res_tpl)
print heat_template_yaml
Good article,Click here
ReplyDelete