Sync Integ to Master
Change-Id: I71e3acc26fa612127756ac04073a522b9cc6cd74
Issue-ID: SDC-977
Signed-off-by: Gitelman, Tal (tg851x) <tg851x@intl.att.com>
diff --git a/asdctool/src/main/resources/config/configuration.yaml b/asdctool/src/main/resources/config/configuration.yaml
index 48529a7..c92827e 100644
--- a/asdctool/src/main/resources/config/configuration.yaml
+++ b/asdctool/src/main/resources/config/configuration.yaml
@@ -31,15 +31,12 @@
artifactGeneratorConfig: Artifact-Generator.properties
resourcesForUpgrade:
5.0:
- - org.openecomp.resource.cp.extCP
- - tosca.nodes.network.Network
- - tosca.nodes.network.Port
- - org.openecomp.resource.cp.nodes.network.SubInterface
+ - tosca.nodes.Root
skipUpgradeFailedVfs: true
skipUpgradeVSPs: true
autoHealingOwner: jh0003
-titanCfgFile: C:\Users\im453s\git\sdc\asdctool\src\main\resources\config\titan.properties
+titanCfgFile: src\main\resources\config\titan.properties
titanMigrationKeySpaceCfgFile: src\main\resources\config\titan-migration.properties
titanInMemoryGraph: false
titanLockTimeout: 1800
@@ -206,7 +203,6 @@
type: TOSCA_CSAR
description: TOSCA definition package of the asset
-
#Informational artifacts placeHolder
excludeResourceCategory:
- Generic
@@ -333,7 +329,7 @@
- xml
AAI_VF_INSTANCE_MODEL:
acceptedTypes:
- - xml
+ - xml
OTHER:
acceptedTypes:
diff --git a/asdctool/src/main/resources/config/error-configuration.yaml b/asdctool/src/main/resources/config/error-configuration.yaml
index d33876a..6a4aece 100644
--- a/asdctool/src/main/resources/config/error-configuration.yaml
+++ b/asdctool/src/main/resources/config/error-configuration.yaml
@@ -100,6 +100,12 @@
message: "Error: Invalid USER_ID '%1'.",
messageId: "SVC4008"
}
+#---------SVC ------------------------------
+ INVALID_SERVICE_STATE: {
+ code: 409,
+ message: "Error: Invalid service state. Expected state: %1, actual state: %2",
+ messageId: ""
+ }
#---------SVC4049------------------------------
# %1 - service/resource
COMPONENT_MISSING_CONTACT: {
@@ -593,7 +599,7 @@
}
#---------SVC4301------------------------------
RESTRICTED_OPERATION: {
- code: 409,
+ code: 403,
message: "Error: Restricted operation.",
messageId: "SVC4301"
}
@@ -1669,3 +1675,18 @@
messageId: "SVC4647"
}
+
+#---------SVC4673------------------------------
+ INVALID_SERVICE_STATE: {
+ code: 409,
+ message: "Error: Invalid service state. Expected state: %1, actual state: %2",
+ messageId: "SVC4673"
+ }
+
+#---------SVC4674------------------------------
+ INVALID_RESPONSE_FROM_PROXY: {
+ code: 502,
+ message: "Error: The server was acting as a gateway or proxy and received an invalid response from the upstream server",
+ messageId: "SVC4674"
+ }
+
diff --git a/asdctool/src/main/resources/scripts/getConsumers.sh b/asdctool/src/main/resources/scripts/getConsumers.sh
new file mode 100644
index 0000000..d02aac6
--- /dev/null
+++ b/asdctool/src/main/resources/scripts/getConsumers.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+##############################
+# Get list of SDC consumers
+##############################
+
+
+CURRENT_DIR=`pwd`
+BASEDIR=$(dirname $0)
+
+if [ ${BASEDIR:0:1} = "/" ]
+then
+ FULL_PATH=$BASEDIR
+else
+ FULL_PATH=$CURRENT_DIR/$BASEDIR
+fi
+
+source ${FULL_PATH}/baseOperation.sh
+
+mainClass="org.openecomp.sdc.asdctool.main.GetConsumersMenu"
+
+command="java $JVM_LOG_FILE -Xmx1024M -cp $JARS $mainClass $@"
+echo $command
+
+$command
+result=$?
+
+
+
+echo "***********************************"
+echo "***** $result *********************"
+echo "***********************************"
+
+exit $result
+
+
+
diff --git a/asdctool/src/main/resources/scripts/python/user/exportUsers.py b/asdctool/src/main/resources/scripts/python/user/exportUsers.py
index e32a3b0..9e695ad 100644
--- a/asdctool/src/main/resources/scripts/python/user/exportUsers.py
+++ b/asdctool/src/main/resources/scripts/python/user/exportUsers.py
@@ -4,17 +4,17 @@
import json
-################################################################################################################################################
-# #
-# Export all active users to file - for 1602+ #
-# #
-# activation : #
-# python exportUsers.py [-i <be host> | --ip=<be host>] [-p <be port> | --port=<be port> ] [-f <output file> | --ofile=<output file> ] #
-# #
-# shortest activation (be host = localhost, be port = 8080): # #
-# python exportUsers.py [-f <output file> | --ofile=<output file> ] #
-# #
-################################################################################################################################################
+####################################################################################################################################################################################
+# #
+# Export all active users to file - for 1602+ #
+# #
+# activation : #
+# python exportUsers.py [-s <scheme> | --scheme=<scheme> ] [-i <be host> | --ip=<be host>] [-p <be port> | --port=<be port> ] [-f <output file> | --ofile=<output file> ] #
+# #
+# shortest activation (be host = localhost, be port = 8080): #
+# python exportUsers.py [-f <output file> | --ofile=<output file> ] #
+# #
+####################################################################################################################################################################################
ALL_USERS_SUFFIX = '/sdc2/rest/v1/user/users'
@@ -25,19 +25,23 @@
print("status=" + str(errorCode))
sys.exit(errorCode)
-def getUsers(beHost, bePort, adminUser):
+def getUsers(scheme, beHost, bePort, adminUser):
try:
buffer = StringIO()
c = pycurl.Curl()
- url = 'http://' + beHost + ':' + bePort + ALL_USERS_SUFFIX
+ url = scheme + '://' + beHost + ':' + bePort + ALL_USERS_SUFFIX
print(url)
c.setopt(c.URL, url)
c.setopt(c.WRITEFUNCTION, buffer.write)
#c.setopt(c.WRITEFUNCTION, lambda x: None)
adminHeader = 'USER_ID: ' + adminUser
c.setopt(pycurl.HTTPHEADER, ['Content-Type: application/json', 'Accept: application/json', adminHeader])
+
+ if scheme == 'https':
+ c.setopt(c.SSL_VERIFYPEER, 0)
+
res = c.perform()
#print(res)
@@ -63,7 +67,7 @@
def usage():
- print sys.argv[0], '[-i <be host> | --ip=<be host>] [-p <be port> | --port=<be port> ] [-f <output file> | --ofile=<output file> ]'
+ print sys.argv[0], '[optional -s <scheme> | --scheme=<scheme>, default http] [-i <be host> | --ip=<be host>] [-p <be port> | --port=<be port> ] [-f <output file> | --ofile=<output file> ]'
def main(argv):
print 'Number of arguments:', len(sys.argv), 'arguments.'
@@ -72,9 +76,10 @@
beHost = 'localhost'
bePort = '8080'
outputfile = None
+ scheme = 'http'
try:
- opts, args = getopt.getopt(argv,"i:p:f:h:",["ip=","port=","ofile="])
+ opts, args = getopt.getopt(argv,"i:p:f:h:s:",["ip=","port=","ofile=","scheme="])
except getopt.GetoptError:
usage()
errorAndExit(2, 'Invalid input')
@@ -90,14 +95,16 @@
bePort = arg
elif opt in ("-f", "--ofile"):
outputfile = arg
+ elif opt in ("-s", "--scheme"):
+ scheme = arg
- print 'be host =',beHost,', be port =', bePort,', output file =',outputfile
+ print 'scheme =',scheme,', be host =',beHost,', be port =', bePort,', output file =',outputfile
if ( outputfile == None ):
usage()
sys.exit(3)
- users = getUsers(beHost, bePort, adminHeader)
+ users = getUsers(scheme, beHost, bePort, adminHeader)
error = users[1]
body = users[0]
diff --git a/asdctool/src/main/resources/scripts/python/user/importUsers.py b/asdctool/src/main/resources/scripts/python/user/importUsers.py
index 669cbbe..984b75b 100644
--- a/asdctool/src/main/resources/scripts/python/user/importUsers.py
+++ b/asdctool/src/main/resources/scripts/python/user/importUsers.py
@@ -4,20 +4,20 @@
import json
import copy
-################################################################################################################################################
-# #
-# 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 all users from a given file #
+# #
+# activation : #
+# python importUsers.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 importUsers.py [-f <input file> | --ifile=<input file> ] #
+# #
+#####################################################################################################################################################################################
-def importUsers(beHost, bePort, users, adminUser):
+def importUsers(scheme, beHost, bePort, users, adminUser):
result = []
@@ -25,12 +25,12 @@
#print("Going to add user " + user['userId'])
- getRes = getUser(beHost, bePort, user)
+ getRes = getUser(scheme, beHost, bePort, user)
userId = getRes[0]
error = getRes[1]
#print error
if ( error != None and error == 404 ):
- res = createUser(beHost, bePort, user ,adminUser)
+ res = createUser(scheme, beHost, bePort, user ,adminUser)
result.append(res)
else:
if ( error == 200 ):
@@ -54,7 +54,7 @@
return cloneUsers
-def getUser(beHost, bePort, user):
+def getUser(scheme, beHost, bePort, user):
userId = user['userId']
try:
@@ -62,12 +62,16 @@
c = pycurl.Curl()
#print type(userId)
- url = 'http://' + beHost + ':' + bePort + '/sdc2/rest/v1/user/' + str(userId)
+ url = scheme + '://' + beHost + ':' + bePort + '/sdc2/rest/v1/user/' + str(userId)
c.setopt(c.URL, url)
#adminHeader = 'USER_ID: ' + adminUser
c.setopt(pycurl.HTTPHEADER, ['Content-Type: application/json', 'Accept: application/json'])
c.setopt(c.WRITEFUNCTION, lambda x: None)
+
+ if scheme == 'https':
+ c.setopt(c.SSL_VERIFYPEER, 0)
+
res = c.perform()
#print("Before get response code")
@@ -87,14 +91,14 @@
-def createUser(beHost, bePort, user, adminUser):
+def createUser(scheme, beHost, bePort, user, adminUser):
userId = user['userId']
try:
buffer = StringIO()
c = pycurl.Curl()
- url = 'http://' + beHost + ':' + bePort + '/sdc2/rest/v1/user'
+ url = scheme + '://' + beHost + ':' + bePort + '/sdc2/rest/v1/user'
c.setopt(c.URL, url)
c.setopt(c.POST, 1)
@@ -105,6 +109,10 @@
c.setopt(c.POSTFIELDS, data)
c.setopt(c.WRITEFUNCTION, lambda x: None)
+
+ if scheme == 'https':
+ c.setopt(c.SSL_VERIFYPEER, 0)
+
#print("before perform")
res = c.perform()
#print(res)
@@ -133,7 +141,7 @@
sys.exit(errorCode)
def usage():
- print sys.argv[0], '[-i <be host> | --ip=<be host>] [-p <be port> | --port=<be port> ] [-f <input file> | --ifile=<input file> ]'
+ print sys.argv[0], '[optional -s <scheme> | --scheme=<scheme>, default http] [-i <be host> | --ip=<be host>] [-p <be port> | --port=<be port> ] [-f <input file> | --ifile=<input file> ]'
def main(argv):
print 'Number of arguments:', len(sys.argv), 'arguments.'
@@ -141,11 +149,11 @@
beHost = 'localhost'
bePort = '8080'
inputfile = None
-
+ scheme = 'http'
adminUser = 'jh0003'
try:
- opts, args = getopt.getopt(argv,"i:p:f:h:",["ip=","port=","ifile="])
+ opts, args = getopt.getopt(argv,"i:p:f:h:s:",["ip=","port=","ifile=","scheme="])
except getopt.GetoptError:
usage()
errorAndExit(2, 'Invalid input')
@@ -161,8 +169,10 @@
bePort = arg
elif opt in ("-f", "--ifile"):
inputfile = arg
+ elif opt in ("-s", "--scheme"):
+ scheme = arg
- print 'be host =',beHost,', be port =', bePort,', users file =',inputfile
+ print 'scheme =',scheme,', be host =',beHost,', be port =', bePort,', users file =',inputfile
if ( inputfile == None ):
usage()
@@ -182,7 +192,7 @@
#print activeUsers
- resultTable = importUsers(beHost, bePort, activeUsers, adminUser)
+ resultTable = importUsers(scheme, beHost, bePort, activeUsers, adminUser)
g = lambda x: x[1] != 201 and x[1] != 409
diff --git a/asdctool/src/main/resources/scripts/sdc-migration.sh b/asdctool/src/main/resources/scripts/sdc-migration.sh
index bbdd6f0..15e6d6b 100644
--- a/asdctool/src/main/resources/scripts/sdc-migration.sh
+++ b/asdctool/src/main/resources/scripts/sdc-migration.sh
@@ -5,7 +5,7 @@
##############################
# in 1802E we do not want to execute automatic post process
-exit 0
+#exit 0
CURRENT_DIR=`pwd`
BASEDIR=$(dirname $0)