2 from sdcBePy.tosca.models.normativeElementCandidate import NormativeElementCandidate
4 def get_normative_element_candidate_list(base_file_location):
6 get_data(base_file_location),
7 get_capability(base_file_location),
8 get_relationship(base_file_location),
9 get_interface_lifecycle(base_file_location),
10 get_categories(base_file_location)
13 def get_normative_element_with_metadata_list(base_file_location):
15 get_group(base_file_location),
16 get_policy(base_file_location)
19 def get_normative_candidate(base_file_location, url, filename, zip_name, with_metadata=False):
20 if path.isdir(base_file_location):
21 return NormativeElementCandidate(base_file_location, url, filename, zip_name, with_metadata=with_metadata)
23 def get_data(base_file_location="/"):
24 return get_normative_candidate(base_file_location + "data-types/",
25 "/sdc2/rest/v1/catalog/uploadType/datatypes",
30 def get_capability(base_file_location="/"):
31 return get_normative_candidate(base_file_location + "capability-types/",
32 "/sdc2/rest/v1/catalog/uploadType/capability",
37 def get_relationship(base_file_location="/"):
38 return get_normative_candidate(base_file_location + "relationship-types/",
39 "/sdc2/rest/v1/catalog/uploadType/relationship",
41 "relationshipTypeZip")
44 def get_interface_lifecycle(base_file_location="../../../import/tosca/"):
45 return get_normative_candidate(base_file_location + "interface-lifecycle-types/",
46 "/sdc2/rest/v1/catalog/uploadType/interfaceLifecycle",
47 "interfaceLifecycleTypes",
48 "interfaceLifecycleTypeZip")
51 def get_categories(base_file_location="/"):
52 return get_normative_candidate(base_file_location + "categories/",
53 "/sdc2/rest/v1/catalog/uploadType/categories",
58 def get_group(base_file_location="/"):
59 return get_normative_candidate(base_file_location + "group-types/",
60 "/sdc2/rest/v1/catalog/uploadType/grouptypes",
66 def get_policy(base_file_location="/"):
67 return get_normative_candidate(base_file_location + "policy-types/",
68 "/sdc2/rest/v1/catalog/uploadType/policytypes",
74 def get_annotation(base_file_location="/"):
75 return get_normative_candidate(base_file_location + "annotation-types/",
76 "/sdc2/rest/v1/catalog/uploadType/annotationtypes",