3 from sdcBePy.tosca.models.normativeTypeCandidate import NormativeTypeCandidate
8 def __init__(self, files):
10 self.load_files(files)
12 def load_files(self, files):
14 with open(file, 'r') as stream:
15 _types = json.load(stream)
16 for type_key, type_value in _types.items():
17 self.types_list[type_key] = type_value
19 def get_type(self, key):
20 return self.types_list[key]
23 def get_heat_and_normative_to_update_list(types, base_file_location):
25 get_heat(types, base_file_location),
26 get_normative(types, base_file_location)
30 def get_nfv_onap_sol_to_update_list(types, base_file_location):
32 get_nfv(types, base_file_location),
33 get_onap(types, base_file_location),
34 get_sol(types, base_file_location)
38 def get_heat(types, base_location="/"):
39 return NormativeTypeCandidate(base_location + "heat-types/",
40 types.get_type("heat"))
43 def get_normative(types, base_location="/"):
44 return NormativeTypeCandidate(base_location + "normative-types/",
45 types.get_type("normative"))
48 def get_nfv(types, base_location="/"):
49 return NormativeTypeCandidate(base_location + "nfv-types/",
50 types.get_type("nfv"))
53 def get_onap(types, base_location="/"):
54 return NormativeTypeCandidate(base_location + "onap-types/",
55 types.get_type("onap"))
58 def get_sol(types, base_location="/"):
59 return NormativeTypeCandidate(base_location + "sol-types/",
60 types.get_type("sol"))