Decouple TXT Report file writing and formatting logic (6/6)
[sdc.git] / catalog-be / src / main / resources / scripts / import / tosca / importAnnotationTypes.py
1 import sys
2
3 from importCommon import parse_cmd_line_params
4 from importNormativeElements import import_element
5
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"
10
11 #####################################################################################################################################################################################
12 #                                                                                                                                                                                                                                                                                                                                                               #
13 # Import tosca data types                                                                                                                                                                                                                                                                                                                       #
14 #                                                                                                                                                                                                                                                                                                                                                                       #
15 # activation :                                                                                                                                                                                                                                                                                                                                          #
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> ]  #
17 #                                                                                                                                                                                                                                                                                                                                                                       #
18 # shortest activation (be host = localhost, be port = 8080):                                                                                                                                                                                                                                            #
19 #               python importAnnotaionTypes.py [-f <input file> | --ifile=<input file> ]                                                                                                                                                                                                #
20 #                                                                                                                                                                                                                                                                                                                                                               #
21 #####################################################################################################################################################################################
22
23
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)
27
28
29 def main(argv):
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)
32
33
34 if __name__ == "__main__":
35     main(sys.argv[1:])