TLS sdc-be-init: truststore & keystore handling
[sdc.git] / catalog-be / src / main / resources / scripts / sdcBePy / tosca / imports / runNormativeType.py
1 #!/usr/bin/env python3
2
3 import sys
4
5 from sdcBePy.common.normative.toscaTypes import process_and_create_normative_types
6 from sdcBePy.tosca.main import get_args, usage
7 from sdcBePy.tosca.models.normativeTypesList import get_normative, get_heat, get_nfv, get_nfv_2_7_1, get_nfv_3_3_1, get_nfv_4_1_1, get_onap, get_sol
8
9
10 def run(candidate, exit_on_success=True):
11     scheme, be_host, be_port, admin_user, update_version, debug, tls_cert, tls_key, tls_key_pw, ca_cert = get_args()
12     try:
13         process_and_create_normative_types(candidate,
14                                            scheme,
15                                            be_host,
16                                            be_port,
17                                            admin_user,
18                                            tls_cert, tls_key, tls_key_pw, ca_cert,
19                                            update_version=update_version,
20                                            debug=debug,
21                                            exit_on_success=exit_on_success)
22     except AttributeError:
23         usage()
24         sys.exit(3)
25
26
27 def run_import_normative():
28     normative_candidate = get_normative()
29     run(normative_candidate)
30
31
32 def run_import_heat():
33     heat_candidate = get_heat()
34     run(heat_candidate)
35
36
37 def run_import_nfv():
38     nfv_candidate = get_nfv()
39     run(nfv_candidate)
40
41 def run_import_nfv_2_7_1():
42     nfv_candidate = get_nfv_2_7_1()
43     run(nfv_candidate)
44
45 def run_import_nfv_3_3_1():
46     nfv_candidate = get_nfv_3_3_1()
47     run(nfv_candidate)
48
49 def run_import_nfv_4_1_1():
50     nfv_candidate = get_nfv_4_1_1()
51     run(nfv_candidate)
52
53 def run_import_onap():
54     onap_candidate = get_onap()
55     run(onap_candidate)
56
57
58 def run_import_sol():
59     sol_candidate = get_sol()
60     run(sol_candidate)
61
62
63 if __name__ == '__main__':
64     run_import_normative()
65     # run_import_heat()
66     # run_import_nfv()
67     # run_import_onap()
68     # run_import_sol()