Versions Compared

Key

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

The objective of this page is to give you some basics about setting up ONAP PNF simulator and how to create a simple CDS blueprint model to perform config-assign and config-deploy using CDS REST API interfaces.

...

              Day-0 : config-assign parameters                          

                             pnf-ipv4-address, netconf-server-port, netconf-username, netconf-password, stream-count


curl -v --location --request POST 'http://localhost:8000/api/v1/execution-service/process' \
--header 'Content-Type: application/json;charset=UTF-8' \
--header 'Accept: application/json;charset=UTF-8,application/json' \
--header 'Authorization: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==' \
--header 'Host: cds-blueprints-processor-http:8080' \
--header 'Content-Type: text/json' \
--data-raw '{
"actionIdentifiers": {
"mode": "sync",
"blueprintName": "pnf_config",
"blueprintVersion": "1.0.0",
"actionName": "config-assign"
},
"payload": {
"config-assign-request": {
"template-prefix": [
"pnf", "netconfrpc"
],
"resolution-key": "day-1",
"config-assign-properties": {
"pnf-id": "abcd",
"pnf-ipv4-address": "192.168.122.20",
"netconf-password": "admin",
"netconf-username": "admin",
"netconf-server-port": "netconf-server-port830",
"stream-count": "5"
}
}
},
"commonHeader": {
"subRequestId": "143748f9-3cd5-4910-81c9-a4601ff2ea58",
"requestId": "e5eb1f1e-3386-435d-b290-d49d8af8db4c",
"originatorId": "SDNC_DG"
}
}'

...

                            pnf-ipv4-address, netconf-server-port, netconf-username, netconf-password, stream-count

curl -v --location --request POST 'http://localhost:8000/api/v1/execution-service/process' \
--header 'Content-Type: application/json;charset=UTF-8' \
--header 'Accept: application/json;charset=UTF-8,application/json' \
--header 'Authorization: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==' \
--header 'Host: cds-blueprints-processor-http:8080' \
--header 'Content-Type: text/json' \
--data-raw '{
"actionIdentifiers": {
"mode": "sync",
"blueprintName": "pnf_config",
"blueprintVersion": "1.0.0",
"actionName": "config-assign"
},
"payload": {
"config-assign-request": {
"template-prefix": [
"pnf", "netconfrpc"
],
"resolution-key": "day-1",
"config-assign-properties": {
"pnf-id": "abcd",
"pnf-ipv4-address": "192.168.122.20",
"netconf-password": "admin",
"netconf-username": "admin",
"netconf-server-port": "
netconf-server-port
830",
"stream-count": "10"
}
}
},
"commonHeader": {
"subRequestId": "143748f9-3cd5-4910-81c9-a4601ff2ea58",
"requestId": "e5eb1f1e-3386-435d-b290-d49d8af8db4c",
"originatorId": "SDNC_DG"
}
}'

On success you should get HTTP status 200 for the above CURL commands. The below is the reference output

* upload completely sent off: 886 out of 886 bytes
< HTTP/1.1 200 OK
< Content-Type: application/json;charset=UTF-8
< Content-Length: 501
< Cache-Control: no-cache, no-store, max-age=0, must-revalidate
< Pragma: no-cache
< Expires: 0
< X-Content-Type-Options: nosniff
< X-Frame-Options: DENY
< X-XSS-Protection: 1 ; mode=block
< Referrer-Policy: no-referrer
<
* Connection #0 to host localhost left intact
{"commonHeader":{"timestamp":"2020-07-21T11:24:33.552Z","originatorId":"SDNC_DG","requestId":"e5eb1f1e-3386-435d-b290-d49d8af8db4c","subRequestId":"143748f9-3cd5-4910-81c9-a4601ff2ea58","flags":null},"actionIdentifiers":{"blueprintName":"pnf_config","blueprintVersion":"1.0.0","actionName":"config-assign","mode":"sync"},"status":{"code":200,"eventType":"EVENT_COMPONENT_EXECUTED","timestamp":"2020-07-21T11:24:33.651Z","errorMessage":null,"message":"success"},"payload":{"config-assign-response":{}}}


Config-Deploy


  • config-deploy request will send the Day-0 or Day-1 resolution key as part of the REST call.

...