diff options
author | Michael Lando <ml636r@att.com> | 2018-03-04 14:53:33 +0200 |
---|---|---|
committer | Michael Lando <ml636r@att.com> | 2018-03-07 13:19:05 +0000 |
commit | a5445100050e49e83f73424198d73cd72d672a4d (patch) | |
tree | cacf4df817df31be23e4e790d1dda857bdae061e /catalog-be/src/main/resources/scripts/import/tosca/importNormativeCapabilities.py | |
parent | 51157f92c21976cba4914c378aaa3cba49826931 (diff) |
Sync Integ to Master
Change-Id: I71e3acc26fa612127756ac04073a522b9cc6cd74
Issue-ID: SDC-977
Signed-off-by: Gitelman, Tal (tg851x) <tg851x@intl.att.com>
Diffstat (limited to 'catalog-be/src/main/resources/scripts/import/tosca/importNormativeCapabilities.py')
-rw-r--r-- | catalog-be/src/main/resources/scripts/import/tosca/importNormativeCapabilities.py | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/catalog-be/src/main/resources/scripts/import/tosca/importNormativeCapabilities.py b/catalog-be/src/main/resources/scripts/import/tosca/importNormativeCapabilities.py index bda02ddda9..e4f92139c2 100644 --- a/catalog-be/src/main/resources/scripts/import/tosca/importNormativeCapabilities.py +++ b/catalog-be/src/main/resources/scripts/import/tosca/importNormativeCapabilities.py @@ -7,25 +7,25 @@ from importNormativeElements import createNormativeElement from importCommon import * import importCommon -################################################################################################################################################ -# # -# Import all users from a given file # -# # -# activation : # -# python importUsers.py [-i <be host> | --ip=<be host>] [-p <be port> | --port=<be port> ] [-f <input file> | --ifile=<input file> ] # -# # -# shortest activation (be host = localhost, be port = 8080): # # -# python importUsers.py [-f <input file> | --ifile=<input file> ] # -# # -################################################################################################################################################ +################################################################################################################################################################################################# +# # +# Import normative capabilities # +# # +# activation : # +# python importNormativeCapabilities.py [-s <scheme> | --scheme=<scheme> ] [-i <be host> | --ip=<be host>] [-p <be port> | --port=<be port> ] [-f <input file> | --ifile=<input file> ] # +# # +# shortest activation (be host = localhost, be port = 8080): # +# python importNormativeCapabilities.py [-f <input file> | --ifile=<input file> ] # +# # +################################################################################################################################################################################################# def usage(): - print sys.argv[0], '[-i <be host> | --ip=<be host>] [-p <be port> | --port=<be port> ] [-u <user userId> | --user=<user userId> ]' + print sys.argv[0], '[optional -s <scheme> | --scheme=<scheme>, default http] [-i <be host> | --ip=<be host>] [-p <be port> | --port=<be port> ] [-u <user userId> | --user=<user userId> ]' -def importNormativeCapabilities(beHost, bePort, adminUser, exitOnSuccess, fileDir): - result = createNormativeElement(beHost, bePort, adminUser, fileDir, "/sdc2/rest/v1/catalog/uploadType/capability", "capabilityTypes", "capabilityTypeZip") +def importNormativeCapabilities(scheme, beHost, bePort, adminUser, exitOnSuccess, fileDir): + result = createNormativeElement(scheme, beHost, bePort, adminUser, fileDir, "/sdc2/rest/v1/catalog/uploadType/capability", "capabilityTypes", "capabilityTypeZip") printFrameLine() printNameAndReturnCode(result[0], result[1]) @@ -44,9 +44,10 @@ def main(argv): beHost = 'localhost' bePort = '8080' adminUser = 'jh0003' + scheme = 'http' try: - opts, args = getopt.getopt(argv,"i:p:u:h:",["ip=","port=","user="]) + opts, args = getopt.getopt(argv,"i:p:u:h:s:",["ip=","port=","user=","scheme="]) except getopt.GetoptError: usage() importCommon.errorAndExit(2, 'Invalid input') @@ -62,14 +63,16 @@ def main(argv): bePort = arg elif opt in ("-u", "--user"): adminUser = arg + elif opt in ("-s", "--scheme"): + scheme = arg - print 'be host =',beHost,', be port =', bePort,', user =', adminUser + print 'scheme =',scheme,', be host =',beHost,', be port =', bePort,', user =', adminUser if ( beHost == None ): usage() sys.exit(3) - importNormativeCapabilities(beHost, bePort, adminUser, True, "../../../import/tosca/capability-types/") + importNormativeCapabilities(scheme, beHost, bePort, adminUser, True, "../../../import/tosca/capability-types/") if __name__ == "__main__": |