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 and cps-tbdmt
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=sondataspace
25 echo "\nCreating schema sets: "
26 curl --location --user cpsuser:cpsr0cks! \
28 http://$CPS_IP:8080/cps/api/v1/dataspaces/sondataspace/schema-sets --form 'file=@"ran-network.zip"' --form 'schema-set-name="ran-network-schemaset"'
30 curl --location --user cpsuser:cpsr0cks! \
32 http://$CPS_IP:8080/cps/api/v1/dataspaces/sondataspace/schema-sets --form 'file=@"cps-ran-updated.zip"' --form 'schema-set-name="cps-ran-schemaset"'
35 echo "\nCreating anchor: "
36 curl --location --user cpsuser:cpsr0cks! --request POST \
37 http://$CPS_IP:8080/cps/api/v1/dataspaces/sondataspace/anchors?schema-set-name=ran-network-schemaset \
38 -d anchor-name=ran-network-anchor
40 curl --location --user cpsuser:cpsr0cks! --request POST \
41 http://$CPS_IP:8080/cps/api/v1/dataspaces/sondataspace/anchors?schema-set-name=cps-ran-schemaset \
42 -d anchor-name=cps-ran-anchor
45 echo "\nUploading cps payload "
46 curl --location --user cpsuser:cpsr0cks! --request POST \
47 http://$CPS_IP:8080/cps/api/v1/dataspaces/sondataspace/anchors/ran-network-anchor/nodes \
48 --header 'Content-Type: application/json' \
49 -d @sim-data/payload-ran-network.json
52 curl --location --user cpsuser:cpsr0cks! --request POST \
53 http://$CPS_IP:8080/cps/api/v1/dataspaces/sondataspace/anchors/cps-ran-anchor/nodes \
54 --header 'Content-Type: application/json' \
55 -d @sim-data/payload-cps-ran.json
58 echo "\nUploading tbdmt-templates"
60 curl --location --request POST \
61 http://$CPS_TBDMT_IP:8080/templates \
62 --header 'Content-Type: application/json' \
63 --data-raw '{"templateId": "get-cell","model": "cps-ran-schemaset","requestType": "query-cps-path","xpathTemplate": "//NRCellCU[@idNRCellCU='\''{{cellId}}'\'']//ancestor::Regions","includeDescendants": true, "transformParam":"Regions"}'
67 curl --location --request POST \
68 http://$CPS_TBDMT_IP:8080/templates \
69 --header 'Content-Type: application/json' \
70 --data-raw '{"templateId": "get-pnf","model": "ran-network-schemaset","requestType": "query-cps-path","xpathTemplate": "//NRCellDU[@idNRCellDU='\''{{cellId}}'\'']/ancestor::GNBDUFunction","includeDescendants": true,"transformParam":"ietf-inet-types:GNBDUFunction"}'
74 curl --location --request POST \
75 http://$CPS_TBDMT_IP:8080/templates \
76 --header 'Content-Type: application/json' \
77 --data-raw '{"templateId": "get-pci","model": "ran-network-schemaset","requestType": "query-cps-path","xpathTemplate": "//NRCellDU[@idNRCellDU='\''{{cellId}}'\'']","includeDescendants": true,"transformParam":"ietf-inet-types:NRCellDU,attributes"}'
81 curl --location --request POST \
82 http://$CPS_TBDMT_IP:8080/templates \
83 --header 'Content-Type: application/json' \
84 --data-raw '{"templateId": "get-nbr-list","model": "cps-ran-schemaset","requestType": "get","xpathTemplate": "/cps-ran-schema/Regions[@regionId='\''{{10000000}}'\'']/cps-region-cell-mapping/NRCellCU[@idNRCellCU='\''{{cellId}}'\'']","includeDescendants": true, "transformParam":"cps-ran-schema-model:NRCellCU"}'