Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Clone the repo from : https://gerrit.onap.org/r/admin/repos/cps
  • Build the project – When building the project run from the root cps folder : mvn clean install
  • From docker-compose folder, run the following after building the images locally : VERSION=latest DB_USERNAME=cps DB_PASSWORD=cps docker-compose up -d
  • Create the dataspace, schemaset, anchor and datanode using the following CPS APIs.

Kindly check this page for more details on CPS APIs Create Dataspace : R9 TBDMT Enhancements

CPS-TBDMT :

Follow the steps below to setup the CPS-TBDMT environment:

  • Clone the repo from : cps/cps-tbdmt · Gerrit Code Review (onap.org)
  • Build the project – mvn clean install

  • Change the docker image name to avoid docker login issues : docker tag nexus3.onap.org:10003/onap/cps-tbdmt:latest cps-tbdmt:latest

  • From the docker-compose folder, edit the application.yml file 

          cpsCoreConfiguration url –  change to VM's IP and the created dataspace's name

          schemaToAnchor mapping – provide the created schemaset and anchor name

...



curl --location --user cpsuser:cpsr0cks! -H "Accept: application/json" -H "Content-Type: application/json" --request POST 'http://localhost:8883/cps/api/v1/dataspaces?dataspace-name=sondataspace'

Create Schemaset :

curl --location --user cpsuser:cpsr0cks! --request POST 'http://localhost:8883/cps/api/v1/dataspaces/sondataspace/schema-sets' --form 'file=@"ran-network.zip"' --form 'schema-set-name="ran-network-schemaset"'

curl --location --user cpsuser:cpsr0cks! --request POST 'http://localhost:8883/cps/api/v1/dataspaces/sondataspace/schema-sets' --form 'file=@"cps-ran-updated.zip"' --form 'schema-set-name="cps-ran-schemaset"'

Create Anchor :

curl --location --user cpsuser:cpsr0cks! --request POST 'http://localhost:8883/cps/api/v1/dataspaces/sondataspace/anchors?schema-set-name=ran-network-schemaset&anchor-name=ran-network-anchor'

curl --location --user cpsuser:cpsr0cks! --request POST 'http://localhost:8883/cps/api/v1/dataspaces/sondataspace/anchors?schema-set-name=cps-ran-schemaset&anchor-name=ran-cps-anchor'

Get all created anchors  :

curl --location --user cpsuser:cpsr0cks! --request GET 'http://localhost:8883/cps/api/v1/dataspaces/sondataspace/anchors'

Create Datanode :

curl --location --user cpsuser:cpsr0cks! --request POST 'http://localhost:8883/cps/api/v1/dataspaces/sondataspace/anchors/ran-network-anchor/nodes' --header 'Content-Type: application/json' -d @ran-network-data.json

curl --location --user cpsuser:cpsr0cks! --request POST 'http://localhost:8883/cps/api/v1/dataspaces/newdataspace/anchors/cps-ran-anchor/nodes' --header 'Content-Type: application/json' -d @updated-csit-ran-data.json


CPS-TBDMT :

Follow the steps below to setup the CPS-TBDMT environment:

  • Clone the repo from : cps/cps-tbdmt · Gerrit Code Review (onap.org)
  • Build the project – mvn clean install

  • Change the docker image name to avoid docker login issues : docker tag nexus3.onap.org:10003/onap/cps-tbdmt:latest cps-tbdmt:latest

  • From the docker-compose folder, edit the application.yml file 

          cpsCoreConfiguration url –  change to VM's IP and the created dataspace's name (sondataspace)

          schemaToAnchor mapping – provide the created schemaset and anchor name ( ran-network-schemaset : ran-network-anchor , cps-ran-schemaset : cps-ran-anchor )

  • From the docker-compose folder, run the following to bring up the containers : docker-compose up -d
  • Once the docker container is up, execute the following TBDMT-APIs

get-cell API :

curl --location --request POST 'http://localhost:8080/templates' --header 'Content-Type: application/json' --data-raw '{
       "templateId": "get-cell",
       "model": "cps-ran-schemaset",
       "requestType": "get",
       "xpathTemplate": "/cps-ran-schema/Regions[@regionId='\''{{regionId}}'\'']/cps-region-cell-mapping",
       "includeDescendants": true
   }' -i

To verify the created template :

curl --location --request POST 'http://localhost:8080/execute/cps-ran-schemaset/get-cell' --header 'Content-Type: application/json' --data-raw '{
       "inputParameters": {
          "regionId":"netw1000"
       }
   }' -i

get-nbr-list API :

curl --location --request POST 'http://localhost:8080/templates' --header 'Content-Type: application/json' --data-raw '{
       "templateId": "get-nbr-list",
       "model": "cps-ran-schemaset",
       "requestType": "get",
       "xpathTemplate": "/cps-ran-schema/Regions[@regionId='\''{{netw1000}}'\'']/cps-region-cell-mapping/NRCellCU[@idNRCellCU='\''{{cellId}}'\'']",
       "includeDescendants": true
   }' -i

To verify the created template :

curl --location --request POST 'http://localhost:8080/execute/cps-ran-schemaset/get-nbr-list' --header 'Content-Type: application/json' --data-raw '{
       "inputParameters": {
          "cellId":"Chn0005"
       }
   }' -i

get-nbr-list1 API : (OOF)

curl --location --request POST 'http://localhost:8080/templates' --header 'Content-Type: application/json' --data-raw '{
       "templateId": "get-nbr-list1",
       "model": "cps-ran-schemaset",
       "requestType": "get",
       "xpathTemplate": "/cps-ran-schema/Regions[@regionId='\''{{regionId}}'\'']/cps-region-cell-mapping/NRCellCU[@idNRCellCU='\''{{idNRCellCU}}'\'']",
       "includeDescendants": true
   }' -i

To verify the created template :

curl --location --request POST 'http://localhost:8080/execute/cps-ran-schemaset/get-nbr-list1' --header 'Content-Type: application/json' --data-raw '{
       "inputParameters": {
          "regionId":"netw1000",
          "idNRCellCU":"Chn0005"
       }
   }' -i

get-pci API :

curl --location --request POST 'http://localhost:8080/templates' --header 'Content-Type: application/json' --data-raw '{
       "templateId": "get-pci",
       "model": "ran-network-schemaset",
       "requestType": "get",
       "xpathTemplate": "/ran-network/NearRTRIC[@idNearRTRIC='\''{{11}}'\'']/GNBDUFunction[@idGNBDUFunction='\''{{110}}'\'']/NRCellDU[@idNRCellDU='\''{{cellId}}'\'']/attributes",
       "includeDescendants": true
   }' -i

To verify the created template :

curl --location --request POST 'http://localhost:8080/execute/ran-network-schemaset/get-pci' --header 'Content-Type: application/json' --data-raw '{
       "inputParameters": {
          "cellId":"Chn0005"
       }
   }' -i

get-pnf API :

curl --location --request POST 'http://localhost:8080/templates' --header 'Content-Type: application/json' --data-raw '{
        "templateId": "get-pnf",
        "model": "ran-network-schemaset",
        "requestType": "query-cps-path",
        "xpathTemplate": "//NRCellCU[@idNRCellCU='\''{{cellId}}'\'']/ancestor::GNBCUCPFunction",
        "includeDescendants": true
}' -i

To verify the created template :

curl --location --request POST 'http://localhost:8080/execute/ran-network-schemaset/get-pnf' --header 'Content-Type: application/json' --data-raw '{
       "inputParameters": {
          "cellId":"Chn0008"
       }
   }' -i

POLICY :

There following control policies that are being used in the usecase. They have to be created and pushed into the policy.

View file
namepci.json
height250
View file
namesonBpci_push.json
height250
View file
namesonBpci.json
height250
View file
namepciBson_push.json
height250
View file
namepciBson.json
height250
View file
nameson_push.json
height250
View file
namepci_push.json
height250
View file
nameson.json
height250

Log in to policy-pdp container.

Execute the following commands:

Create and push  Modify Config policy.

Modify Config policy

curl -k --silent --user 'healthcheck:zb!XztG34' -X POST "https://policy-api:6969/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0/policies" -H "Accept: application/json" -H "Content-Type: application/json" -d @pci.json

curl --silent -k --user 'healthcheck:zb!XztG34' -X POST "https://policy-pap:6969/policy/pap/v1/pdps/policies" -H "Accept: application/json" -H "Content-Type: application/json" -d @pci_push.json

Create and push Modify Config ANR policy.

Modify Config ANR policy

curl -k --silent --user 'healthcheck:zb!XztG34' -X POST "https://policy-api:6969/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0/policies" -H "Accept: application/json" -H "Content-Type: application/json" -d @son.json

curl --silent -k --user 'healthcheck:zb!XztG34' -X POST "https://policy-pap:6969/policy/pap/v1/pdps/policies" -H "Accept: application/json" -H "Content-Type: application/json" -d @son_push.json

Create and push PCI-controlloop-guard(Controlloop-denial) policy:

PCI-guard

curl -k --silent --user 'healthcheck:zb!XztG34' -X POST "https://policy-api:6969/policy/api/v1/policytypes/onap.policies.controlloop.guard.coordination.FirstBlocksSecond/versions/1.0.0/policies" -H "Accept: application/json" -H "Content-Type: application/json" -d @pciBson.json 

curl --silent -k --user 'healthcheck:zb!XztG34' -X POST "https://policy-pap:6969/policy/pap/v1/pdps/policies" -H "Accept: application/json" -H "Content-Type: application/json" -d @pciBson_push.json 

Create and push ANR-controlloop-guard policy:

ANR-guard

curl -k --silent --user 'healthcheck:zb!XztG34' -X POST "https://policy-api:6969/policy/api/v1/policytypes/onap.policies.controlloop.guard.coordination.FirstBlocksSecond/versions/1.0.0/policies" -H "Accept: application/json" -H "Content-Type: application/json" -d @sonBpci.json 

curl --silent -k --user 'healthcheck:zb!XztG34' -X POST "https://policy-pap:6969/policy/pap/v1/pdps/policies" -H "Accept: application/json" -H "Content-Type: application/json" -d @sonBpci_push.json  

SON-HANDLER :

Configure the SON-Handler with the below CPS details and then deploy.

...