3 #Building cps-tbdmt image
4 git clone "https://gerrit.onap.org/r/cps/cps-tbdmt"
5 mvn -f cps-tbdmt/ -Dmaven.test.skip clean install --settings settings.xml
8 #Creating containers for cps, cps-tbdmt & aai-resources
13 # uploading data to cps & cps-tbdmt
14 CPS_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' cps-and-ncmp )
16 CPS_TBDMT_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' cps-tbdmt )
19 echo "Creating dataspace: "
20 curl --location --user cpsuser:cpsr0cks! -H "Accept: application/json" -H "Content-Type: application/json" \
22 http://$CPS_IP:8080/cps/api/v1/dataspaces?dataspace-name=E2EDemo
24 echo "\nCreating schema set: "
25 curl --location --user cpsuser:cpsr0cks! \
27 http://$CPS_IP:8080/cps/api/v1/dataspaces/E2EDemo/schema-sets --form 'file=@"ran-network.zip"' --form 'schema-set-name="ran-network"'
29 echo "\nCreating anchor: "
30 curl --location --user cpsuser:cpsr0cks! --request POST \
31 http://$CPS_IP:8080/cps/api/v1/dataspaces/E2EDemo/anchors?schema-set-name=ran-network \
32 -d anchor-name=ran-network-anchor
34 echo "\nUploading cps payload "
35 curl --location --user cpsuser:cpsr0cks! --request POST \
36 http://$CPS_IP:8080/cps/api/v1/dataspaces/E2EDemo/anchors/ran-network-anchor/nodes \
37 --header 'Content-Type: application/json' \
38 -d @sim-data/payload-ran-network.json
41 echo "\nuploading tbdmt-templates"
42 curl --location --request POST \
43 http://$CPS_TBDMT_IP:8080/templates \
44 --header 'Content-Type: application/json' \
45 --data-raw '{"templateId": "get-nearrtric-config","model": "ran-network","requestType": "query-cps-path","xpathTemplate": "//sNSSAIList[@sNssai='\''{{sNssai}}'\'']/ancestor::NearRTRIC","includeDescendants": true}'
47 curl --location --request POST \
48 http://$CPS_TBDMT_IP:8080/templates \
49 --header 'Content-Type: application/json' \
50 --data-raw '{"templateId": "get-gnbdufunction-by-snssai","model": "ran-network","requestType": "query-cps-path","xpathTemplate": "//sNSSAIList[@sNssai='\''{{sNssai}}'\'']/ancestor::GNBDUFunction","includeDescendants": true}'
52 curl --location --request POST \
53 http://$CPS_TBDMT_IP:8080/templates \
54 --header 'Content-Type: application/json' \
55 --data-raw '{"templateId": "get-nrcelldu-by-snssai","model": "ran-network","requestType": "query-cps-path","xpathTemplate": "//sNSSAIList[@sNssai='\''{{sNssai}}'\'']/ancestor::NearRTRIC","includeDescendants": true}'
59 AAI_RESOURCES_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' aai-resources )
61 echo "\nUploading data to aai-resources"
62 curl --request PUT -H "X-FromAppId:AAI " -H "X-TransactionId:get_aai_subscr" -H "Accept:application/json" -H "Content-Type:application/json" -k \
63 https://$AAI_RESOURCES_IP:8447/aai/v21/business/customers/customer/5GCustomer \
64 -d @sim-data/customers.json
66 curl --request PUT -H "X-FromAppId:AAI " -H "X-TransactionId:get_aai_subscr" -H "Accept:application/json" -H "Content-Type:application/json" -k \
67 https://$AAI_RESOURCES_IP:8447/aai/v21/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G \
68 -d @sim-data/service_subscriptions.json
70 curl --request PUT -H "X-FromAppId:AAI " -H "X-TransactionId:get_aai_subscr" -H "Accept:application/json" -H "Content-Type:application/json" -k \
71 https://$AAI_RESOURCES_IP:8447/aai/v21/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/3f2f23fa-c567-4dd8-8f15-f95ae3e6fd84 \
72 -d @sim-data/service_instances.json
74 curl --request PUT -H "X-FromAppId:AAI " -H "X-TransactionId:get_aai_subscr" -H "Accept:application/json" -H "Content-Type:application/json" -k \
75 https://$AAI_RESOURCES_IP:8447/aai/v24/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/3f2f23fa-c567-4dd8-8f15-f95ae3e6fd84/slice-profiles/slice-profile/684hf846f-863b-4901-b202-0ab86a638555 \
76 -d @sim-data/slice_profile.json