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_onap_sol_to_update_list(types, base_file_location):
32 get_onap(types, base_file_location),
33 get_sol(types, base_file_location)
36 def get_nfv_to_update_list(types, base_file_location):
38 get_nfv(types, base_file_location),
39 get_nfv_2_7_1(types, base_file_location),
40 get_nfv_3_3_1(types, base_file_location),
41 get_nfv_4_1_1(types, base_file_location),
45 def get_heat(types, base_location="/"):
46 return NormativeTypeCandidate(base_location + "heat-types/",
47 types.get_type("heat"))
50 def get_normative(types, base_location="/"):
51 return NormativeTypeCandidate(base_location + "normative-types/",
52 types.get_type("normative"))
55 def get_nfv(types, base_location="/"):
56 return NormativeTypeCandidate(base_location + "nfv-types/",
57 types.get_type("nfv"))
59 def get_nfv_2_7_1(types, base_location="/"):
60 return NormativeTypeCandidate(base_location + "nfv-types/2.7.1/",
61 types.get_type("nfv_2_7_1"))
63 def get_nfv_3_3_1(types, base_location="/"):
64 return NormativeTypeCandidate(base_location + "nfv-types/3.3.1/",
65 types.get_type("nfv_3_3_1"))
67 def get_nfv_4_1_1(types, base_location="/"):
68 return NormativeTypeCandidate(base_location + "nfv-types/4.1.1/",
69 types.get_type("nfv_4_1_1"))
71 def get_onap(types, base_location="/"):
72 return NormativeTypeCandidate(base_location + "onap-types/",
73 types.get_type("onap"))
76 def get_sol(types, base_location="/"):
77 return NormativeTypeCandidate(base_location + "sol-types/",
78 types.get_type("sol"))