3 from importCommon import parse_cmd_line_params
4 from importNormativeElements import import_element
6 IMPORT_ANNOTATION_URL = "/sdc2/rest/v1/catalog/uploadType/annotationtypes"
7 ANNOTATION_FILE_PATH = "../../../import/tosca/annotation-types/"
8 ANNOTATION_ZIP_FILE = "annotationTypesZip"
9 ANNOTATION_ELEMENT_NAME = "annotationTypes"
11 #####################################################################################################################################################################################
13 # Import tosca data types #
16 # python importAnnotaionTypes.py [-s <scheme> | --scheme=<scheme> ] [-i <be host> | --ip=<be host>] [-p <be port> | --port=<be port> ] [-f <input file> | --ifile=<input file> ] #
18 # shortest activation (be host = localhost, be port = 8080): #
19 # python importAnnotaionTypes.py [-f <input file> | --ifile=<input file> ] #
21 #####################################################################################################################################################################################
24 def import_annotation_types(scheme, be_host, be_port, admin_user, exit_on_success):
25 import_element(scheme, be_host, be_port, admin_user, exit_on_success, ANNOTATION_FILE_PATH, IMPORT_ANNOTATION_URL,
26 ANNOTATION_ELEMENT_NAME, ANNOTATION_ZIP_FILE)
30 scheme, be_host, be_port, admin_user = parse_cmd_line_params(argv)
31 import_annotation_types(scheme, be_host, be_port, admin_user, True)
34 if __name__ == "__main__":