4 echo "Usage: $0 <hostIp> <hostPort> <userId>"
7 function addResource() {
10 echo -e "###################### Adding Element ${ELEMENT_NAME} Start ######################"
11 CURRENT_ZIP_FILE=./${ELEMENT_NAME}/${ELEMENT_NAME}.zip
12 CURRENT_JSON_FILE=./${ELEMENT_NAME}/${ELEMENT_NAME}.json
13 sed -i 's/"userId": ".*",/"userId": "'${ATT_UID}'",/' ${CURRENT_JSON_FILE}
14 JSON_CONTENT=`paste -s ${CURRENT_JSON_FILE}`
15 http_code=$(curl -s -o /dev/null -w "%{http_code}" -v -F resourceMetadata="${JSON_CONTENT}" -F resourceZip=@${CURRENT_ZIP_FILE} -H USER_ID:${ATT_UID} ${HOST_IP}:${HOST_PORT}/sdc2/rest/v1/catalog/upload/multipart)
16 if [ ${http_code} -eq 201 ]; then
17 echo -e "\n###################### Adding Element ${ELEMENT_NAME} End ########################\n\n\n"
18 elif [ ${http_code} -eq 409 ]; then
19 echo -e "\n###################### Already exists Element ${ELEMENT_NAME} status code:${http_code} End ########################\n\n\n"
20 elif [ ${http_code} -eq 500 ]; then
21 echo -e "\n###################### Failed to add Element ${ELEMENT_NAME} status code:${http_code} End ########################\n\n\n"
36 if [ "$NO_CAPS" = "nocaps" ]; then
37 echo "Skipping Caps import..."
39 #Add The CapabilityTypes
40 http_code=$(curl -s -o /dev/null -w "%{http_code}" -v -F capabilityTypeZip=@capabilityTypes.zip -H "USER_ID: jh0003" ${HOST_IP}:${HOST_PORT}/sdc2/rest/v1/catalog/uploadType/capability)
41 if [ ${http_code} -eq 201 ]; then
42 echo -e "\n###################### Adding The CapabilityTypes status code:${http_code} End ########################\n\n\n"
43 elif [ ${http_code} -eq 500 ]; then
44 echo -e "\n###################### Failed to add CapabilityTypes status code:${http_code} End ########################\n\n\n"
47 echo -e "\n###################### Failed to add CapabilityTypes status code:${http_code} End ########################\n\n\n"
50 #Add The InterfaceLifecycleTypes
51 #http_code=$(curl -s -o /dev/null -w "%{http_code}" -v -F interfaceLifecycleTypeZip=@interfaceLifecycleTypes.zip -H "USER_ID: jh0003" ${HOST_IP}:${HOST_PORT}/sdc2/rest/v1/catalog/uploadType/interfaceLifecycle)
52 #if [ ${http_code} -eq 201 ]; then
53 # echo -e "\n###################### Adding The InterfaceLifecycleTypes status code:${http_code} End ########################\n\n\n"
54 #elif [ ${http_code} -eq 409 ]; then
55 # echo -e "\n###################### Already exists InterfaceLifecycleTypes status code:${http_code} End ########################\n\n\n"
56 #elif [ ${http_code} -eq 500 ]; then
57 # echo -e "\n###################### Failed to add InterfaceLifecycleTypes status code:${http_code} End ########################\n\n\n"
60 # echo -e "\n###################### Failed to add InterfaceLifecycleTypes status code:${http_code} End ########################\n\n\n"
65 addResource "asdc.nodes.Root"
66 addResource "asdc.nodes.Network"
67 addResource "asdc.nodes.network.Cinder"
68 addResource "asdc.nodes.network.Core"
69 addResource "asdc.nodes.network.DMZ"
70 addResource "asdc.nodes.network.OAM"
71 addResource "asdc.nodes.network.Traffic"
72 addResource "asdc.nodes.network.Internal"
73 addResource "asdc.nodes.Module"
74 addResource "asdc.nodes.module.ECA_OAM"
75 addResource "asdc.nodes.module.ECA_TRX"
76 addResource "asdc.nodes.module.F5_LTM"
77 addResource "asdc.nodes.module.MMSC"
78 addResource "asdc.nodes.module.NEMS_BE"
79 addResource "asdc.nodes.module.NEMS_FE"