JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 1 | .. This work is a derivative of https://wiki.onap.org/display/DW/PNF+Simulator+Day-N+config-assign+and+config-deploy+use+case |
| 2 | .. This work is licensed under a Creative Commons Attribution 4.0 |
| 3 | .. International License. http://creativecommons.org/licenses/by/4.0 |
| 4 | .. Copyright (C) 2020 Deutsche Telekom AG. |
| 5 | |
| 6 | PNF Simulator Day-N config-assign/deploy |
| 7 | ======================================== |
| 8 | |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 9 | Overview |
| 10 | ~~~~~~~~~~ |
| 11 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 12 | This use case shows in a very simple how the day-n configuration is assigned and deployed to a PNF through CDS. |
| 13 | A Netconf server (docker image `sysrepo/sysrepo-netopeer2`) is used for simulating the PNF. |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 14 | |
| 15 | This use case (POC) solely requires a running CDS and the PNF Simulator running on a VM (Ubuntu is used by the author). |
| 16 | No other module of ONAP is needed. |
| 17 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 18 | There are different ways to run CDS and the PNF simulator. This guide will show |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 19 | different possible options to allow the greatest possible flexibility. |
| 20 | |
| 21 | Run CDS (Blueprint Processor) |
| 22 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 23 | |
| 24 | CDS can be run in Kubernetes (Minikube, Microk8s) or in an IDE. You can choose your favorite option. |
| 25 | Just the blueprint processor of CDS is needed. If you have desktop access it is recommended to run CDS in an IDE since |
| 26 | it is easy and enables debugging. |
| 27 | |
| 28 | * CDS in Microk8s: https://wiki.onap.org/display/DW/Running+CDS+on+Microk8s (RDT link to be added) |
| 29 | * CDS in Minikube: https://wiki.onap.org/display/DW/Running+CDS+in+minikube (RDT link to be added) |
| 30 | * CDS in an IDE: https://docs.onap.org/projects/onap-ccsdk-cds/en/latest/userguide/running-bp-processor-in-ide.html |
| 31 | |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 32 | Run PNF Simulator and install module |
| 33 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 34 | |
| 35 | There are many different ways to run a Netconf Server to simulate the PNF, in this guide `sysrepo/sysrepo-netopeer2` |
| 36 | docker image is commonly used. The easiest way is to run the out-of-the-box docker container without any |
| 37 | other configuration, modules or scripts. In the ONAP community there are other workflows existing for running the |
| 38 | PNF Simulator. These workflows are also using `sysrepo/sysrepo-netopeer2` docker image. These workflow are also linked |
| 39 | here but they are not tested by the author of this guide. |
| 40 | |
| 41 | .. tabs:: |
| 42 | |
| 43 | .. tab:: sysrepo/sysrepo-netopeer2 (latest) |
| 44 | |
| 45 | .. warning:: |
| 46 | Currently there is an issue for the SSH connection between CDS and the netconf server because of unmatching |
JakobKrieg | abfdc07 | 2020-10-06 16:49:39 +0200 | [diff] [blame] | 47 | exchange key algorhithms |
| 48 | (see `Stackoverflow <https://stackoverflow.com/questions/64047502/java-lang-illegalstateexception-unable-to-negotiate-key-exchange-for-server-hos>`_). |
| 49 | **Use legacy version (right tab) until the issue is resolved.** |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 50 | |
| 51 | Download and run docker container with ``docker run -d --name netopeer2 -p 830:830 -p 6513:6513 sysrepo/sysrepo-netopeer2:latest`` |
| 52 | |
| 53 | Enter the container with ``docker exec -it netopeer2 bin/bash`` |
| 54 | |
| 55 | Browse to the target location where all YANG modules exist: ``cd /etc/sysrepo/yang`` |
| 56 | |
JakobKrieg | abfdc07 | 2020-10-06 16:49:39 +0200 | [diff] [blame] | 57 | Create a simple mock YANG model for a packet generator (:file:`pg.yang`). |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 58 | |
| 59 | .. code-block:: sh |
| 60 | :caption: **pg.yang** |
| 61 | |
| 62 | module sample-plugin { |
| 63 | |
| 64 | yang-version 1; |
| 65 | namespace "urn:opendaylight:params:xml:ns:yang:sample-plugin"; |
| 66 | prefix "sample-plugin"; |
| 67 | |
| 68 | description |
| 69 | "This YANG module defines the generic configuration and |
| 70 | operational data for sample-plugin in VPP"; |
| 71 | |
| 72 | revision "2016-09-18" { |
| 73 | description "Initial revision of sample-plugin model"; |
| 74 | } |
| 75 | |
| 76 | container sample-plugin { |
| 77 | |
| 78 | uses sample-plugin-params; |
| 79 | description "Configuration data of sample-plugin in Honeycomb"; |
| 80 | |
| 81 | // READ |
| 82 | // curl -u admin:admin http://localhost:8181/restconf/config/sample-plugin:sample-plugin |
| 83 | |
| 84 | // WRITE |
| 85 | // curl http://localhost:8181/restconf/operational/sample-plugin:sample-plugin |
| 86 | |
| 87 | } |
| 88 | |
| 89 | grouping sample-plugin-params { |
| 90 | container pg-streams { |
| 91 | list pg-stream { |
| 92 | |
| 93 | key id; |
| 94 | leaf id { |
| 95 | type string; |
| 96 | } |
| 97 | |
| 98 | leaf is-enabled { |
| 99 | type boolean; |
| 100 | } |
| 101 | } |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | |
JakobKrieg | abfdc07 | 2020-10-06 16:49:39 +0200 | [diff] [blame] | 106 | Create the following sample XML data definition for the above model (:file:`pg-data.xml`). |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 107 | Later on this will initialise one single PG stream. |
| 108 | |
| 109 | .. code-block:: sh |
| 110 | :caption: **pg-data.xml** |
| 111 | |
| 112 | <sample-plugin xmlns="urn:opendaylight:params:xml:ns:yang:sample-plugin"> |
| 113 | <pg-streams> |
| 114 | <pg-stream> |
| 115 | <id>1</id> |
| 116 | <is-enabled>true</is-enabled> |
| 117 | </pg-stream> |
| 118 | </pg-streams> |
| 119 | </sample-plugin> |
| 120 | |
| 121 | Execute the following command within netopeer docker container to install the pg.yang model |
| 122 | |
| 123 | .. code-block:: sh |
| 124 | |
| 125 | sysrepoctl -v3 -i pg.yang |
| 126 | |
| 127 | .. note:: |
| 128 | This command will just schedule the installation, it will be applied once the server is restarted. |
| 129 | |
| 130 | Stop the container from outside with ``docker stop netopeer2`` and start it again with ``docker start netopeer2`` |
| 131 | |
| 132 | Enter the container like it's mentioned above with ``docker exec -it netopeer2 bin/bash``. |
| 133 | |
| 134 | You can check all installed modules with ``sysrepoctl -l``. `sample-plugin` module should appear with ``I`` flag. |
| 135 | |
| 136 | Execute the following the commands to initialise the Yang model with one pg-stream record. |
JakobKrieg | ebd1fbd | 2020-10-02 16:53:27 +0200 | [diff] [blame] | 137 | We will be using CDS to perform the day-1 and day-2 configuration changes. |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 138 | |
| 139 | .. code-block:: sh |
| 140 | |
| 141 | netopeer2-cli |
| 142 | > connect --host localhost --login root |
| 143 | # passwort is root |
| 144 | > get --filter-xpath /sample-plugin:* |
| 145 | # shows existing pg-stream records (empty) |
| 146 | > edit-config --target running --config=/etc/sysrepo/yang/pg-data.xml |
| 147 | # initialises Yang model with one pg-stream record |
| 148 | > get --filter-xpath /sample-plugin:* |
| 149 | # shows initialised pg-stream |
| 150 | |
| 151 | If the output of the last command is like this, everything went successful: |
| 152 | |
| 153 | .. code-block:: sh |
| 154 | |
| 155 | DATA |
| 156 | <sample-plugin xmlns="urn:opendaylight:params:xml:ns:yang:sample-plugin"> |
| 157 | <pg-streams> |
| 158 | <pg-stream> |
| 159 | <id>1</id> |
| 160 | <is-enabled>true</is-enabled> |
| 161 | </pg-stream> |
| 162 | </pg-streams> |
| 163 | </sample-plugin> |
| 164 | |
| 165 | |
| 166 | .. tab:: sysrepo/sysrepo-netopeer2 (legacy) |
| 167 | |
| 168 | Download and run docker container with ``docker run -d --name netopeer2 -p 830:830 -p 6513:6513 sysrepo/sysrepo-netopeer2:legacy`` |
| 169 | |
| 170 | Enter the container with ``docker exec -it netopeer2 bin/bash`` |
| 171 | |
| 172 | Browse to the target location where all YANG modules exist: ``cd /opt/dev/sysrepo/yang`` |
| 173 | |
JakobKrieg | abfdc07 | 2020-10-06 16:49:39 +0200 | [diff] [blame] | 174 | Create a simple mock YANG model for a packet generator (:file:`pg.yang`). |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 175 | |
| 176 | .. code-block:: sh |
| 177 | :caption: **pg.yang** |
| 178 | |
| 179 | module sample-plugin { |
| 180 | |
| 181 | yang-version 1; |
| 182 | namespace "urn:opendaylight:params:xml:ns:yang:sample-plugin"; |
| 183 | prefix "sample-plugin"; |
| 184 | |
| 185 | description |
| 186 | "This YANG module defines the generic configuration and |
| 187 | operational data for sample-plugin in VPP"; |
| 188 | |
| 189 | revision "2016-09-18" { |
| 190 | description "Initial revision of sample-plugin model"; |
| 191 | } |
| 192 | |
| 193 | container sample-plugin { |
| 194 | |
| 195 | uses sample-plugin-params; |
| 196 | description "Configuration data of sample-plugin in Honeycomb"; |
| 197 | |
| 198 | // READ |
| 199 | // curl -u admin:admin http://localhost:8181/restconf/config/sample-plugin:sample-plugin |
| 200 | |
| 201 | // WRITE |
| 202 | // curl http://localhost:8181/restconf/operational/sample-plugin:sample-plugin |
| 203 | |
| 204 | } |
| 205 | |
| 206 | grouping sample-plugin-params { |
| 207 | container pg-streams { |
| 208 | list pg-stream { |
| 209 | |
| 210 | key id; |
| 211 | leaf id { |
| 212 | type string; |
| 213 | } |
| 214 | |
| 215 | leaf is-enabled { |
| 216 | type boolean; |
| 217 | } |
| 218 | } |
| 219 | } |
| 220 | } |
| 221 | } |
| 222 | |
JakobKrieg | abfdc07 | 2020-10-06 16:49:39 +0200 | [diff] [blame] | 223 | Create the following sample XML data definition for the above model (:file:`pg-data.xml`). |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 224 | Later on this will initialise one single PG (packet-generator) stream. |
| 225 | |
| 226 | .. code-block:: sh |
| 227 | :caption: **pg-data.xml** |
| 228 | |
| 229 | <sample-plugin xmlns="urn:opendaylight:params:xml:ns:yang:sample-plugin"> |
| 230 | <pg-streams> |
| 231 | <pg-stream> |
| 232 | <id>1</id> |
| 233 | <is-enabled>true</is-enabled> |
| 234 | </pg-stream> |
| 235 | </pg-streams> |
| 236 | </sample-plugin> |
| 237 | |
| 238 | Execute the following command within netopeer docker container to install the pg.yang model |
| 239 | |
| 240 | .. code-block:: sh |
| 241 | |
| 242 | sysrepoctl -i -g pg.yang |
| 243 | |
| 244 | You can check all installed modules with ``sysrepoctl -l``. `sample-plugin` module should appear with ``I`` flag. |
| 245 | |
| 246 | In legacy version of `sysrepo/sysrepo-netopeer2` subscribers of a module are required, otherwise they are not |
| 247 | running and configurations changes are not accepted, see https://github.com/sysrepo/sysrepo/issues/1395. There is |
| 248 | an predefined application mock up which can be used for that. The usage is described |
JakobKrieg | abfdc07 | 2020-10-06 16:49:39 +0200 | [diff] [blame] | 249 | here: https://asciinema.org/a/160247. You need to run the following |
| 250 | commands to start the example application for subscribing to our sample-plugin YANG module. |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 251 | |
| 252 | .. code-block:: sh |
| 253 | |
| 254 | cd /opt/dev/sysrepo/build/examples |
| 255 | ./application_example sample-plugin |
| 256 | |
| 257 | Following output should appear: |
| 258 | |
| 259 | .. code-block:: sh |
| 260 | |
JakobKrieg | abfdc07 | 2020-10-06 16:49:39 +0200 | [diff] [blame] | 261 | ========== READING STARTUP CONFIG sample-plugin: ========== |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 262 | |
| 263 | /sample-plugin:sample-plugin (container) |
| 264 | /sample-plugin:sample-plugin/pg-streams (container) |
JakobKrieg | abfdc07 | 2020-10-06 16:49:39 +0200 | [diff] [blame] | 265 | |
| 266 | |
| 267 | ========== STARTUP CONFIG sample-plugin APPLIED AS RUNNING ========== |
| 268 | |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 269 | |
| 270 | The terminal session needs to be kept open after application has started. |
| 271 | |
| 272 | Open a new terminal and enter the container with ``docker exec -it netopeer2 bin/bash``. |
| 273 | Execute the following commands in the container to initialise the Yang model with one pg-stream record. |
| 274 | We will be using CDS to perform the day-1 configuration and day-2 configuration changes. |
| 275 | |
| 276 | .. code-block:: sh |
| 277 | |
| 278 | netopeer2-cli |
| 279 | > connect --host localhost --login netconf |
| 280 | # passwort is netconf |
| 281 | > get --filter-xpath /sample-plugin:* |
| 282 | # shows existing pg-stream records (empty) |
| 283 | > edit-config --target running --config=/opt/dev/sysrepo/yang/pg-data.xml |
| 284 | # initialises Yang model with one pg-stream record |
| 285 | > get --filter-xpath /sample-plugin:* |
| 286 | # shows initialised pg-stream |
| 287 | |
| 288 | If the output of the last command is like this, everything went successful: |
| 289 | |
| 290 | .. code-block:: sh |
| 291 | |
| 292 | DATA |
| 293 | <sample-plugin xmlns="urn:opendaylight:params:xml:ns:yang:sample-plugin"> |
| 294 | <pg-streams> |
| 295 | <pg-stream> |
| 296 | <id>1</id> |
| 297 | <is-enabled>true</is-enabled> |
| 298 | </pg-stream> |
| 299 | </pg-streams> |
| 300 | </sample-plugin> |
| 301 | |
JakobKrieg | abfdc07 | 2020-10-06 16:49:39 +0200 | [diff] [blame] | 302 | You can also see that there are additional logs in the subscriber application after editing the configuration of our |
| 303 | YANG module. |
| 304 | |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 305 | .. tab:: PNF simulator integration project |
| 306 | |
| 307 | .. warning:: |
| 308 | This method of setting up the PNF simulator is not tested by the author of this guide |
| 309 | |
| 310 | You can refer to `PnP PNF Simulator wiki page <https://wiki.onap.org/display/DW/PnP+PNF+Simulator>`_ |
| 311 | to clone the GIT repo and start the required docker containers. We are interested in the |
| 312 | `sysrepo/sysrepo-netopeer2` docker container to load a simple YANG similar to vFW Packet Generator. |
| 313 | |
| 314 | Start PNF simulator docker containers. You can consider changing the netopeer image verion to image: |
| 315 | `sysrepo/sysrepo-netopeer2:iop` in docker-compose.yml file If you find any issues with the default image. |
| 316 | |
| 317 | .. code-block:: sh |
| 318 | |
| 319 | cd $HOME |
| 320 | |
| 321 | git clone https://github.com/onap/integration.git |
| 322 | |
| 323 | Start PNF simulator |
| 324 | |
| 325 | cd ~/integration/test/mocks/pnfsimulator |
| 326 | |
| 327 | ./simulator.sh start |
| 328 | |
| 329 | Verify that you have netopeer docker container are up and running. It will be mapped to host port 830. |
| 330 | |
| 331 | .. code-block:: sh |
| 332 | |
| 333 | docker ps -a | grep netopeer |
| 334 | |
| 335 | |
| 336 | Config-assign and config-deploy in CDS |
| 337 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 338 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 339 | In the following steps config-assignment is done and the config is deployed to the |
| 340 | Netconf server through CDS. Example requests are in the following Postman collection |
| 341 | :download:`JSON <media/pnf-simulator.postman_collection.json>`. You can also use bash scripting to call the APIs. |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 342 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 343 | .. note:: |
| 344 | The CBA for this PNF Demo gets loaded, enriched and saved in CDS through calling bootstrap. If not done before, call |
| 345 | Bootstrap API |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 346 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 347 | Password and username for API calls will be `ccsdkapps`. |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 348 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 349 | **Config-Assign:** |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 350 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 351 | The assumption is that we are using the same host to run PNF NETCONF simulator as well as CDS. You will need the |
| 352 | IP Adress of the Netconf server container which can be found out with |
| 353 | ``docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' netopeer2``. In the |
| 354 | following example payloads we will use 172.17.0.2. |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 355 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 356 | Call the `process` API (``http://{{host}}:{{port}}/api/v1/execution-service/process``) with POST method to |
| 357 | create day-1 configuration. Use the following payload: |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 358 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 359 | .. code-block:: JSON |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 360 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 361 | { |
| 362 | "actionIdentifiers": { |
| 363 | "mode": "sync", |
| 364 | "blueprintName": "pnf_netconf", |
| 365 | "blueprintVersion": "1.0.0", |
| 366 | "actionName": "config-assign" |
| 367 | }, |
| 368 | "payload": { |
| 369 | "config-assign-request": { |
| 370 | "resolution-key": "day-1", |
| 371 | "config-assign-properties": { |
| 372 | "stream-count": 5 |
| 373 | } |
| 374 | } |
| 375 | }, |
| 376 | "commonHeader": { |
| 377 | "subRequestId": "143748f9-3cd5-4910-81c9-a4601ff2ea58", |
| 378 | "requestId": "e5eb1f1e-3386-435d-b290-d49d8af8db4c", |
| 379 | "originatorId": "SDNC_DG" |
| 380 | } |
| 381 | } |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 382 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 383 | You can verify the day-1 NETCONF RPC payload looking into CDS DB. You should see the NETCONF RPC with 5 |
| 384 | streams (fw_udp_1 TO fw_udp_5). Connect to the DB and run the below statement. You should |
| 385 | see the day-1 configuration as an output. |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 386 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 387 | .. code-block:: sh |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 388 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 389 | MariaDB [sdnctl]> select * from TEMPLATE_RESOLUTION where resolution_key='day-1' AND artifact_name='netconfrpc'; |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 390 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 391 | <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> |
| 392 | <edit-config> |
| 393 | <target> |
| 394 | <running/> |
| 395 | </target> |
| 396 | <config> |
| 397 | <sample-plugin xmlns="urn:opendaylight:params:xml:ns:yang:sample-plugin"> |
| 398 | <pg-streams> |
| 399 | <pg-stream> |
| 400 | <id>fw_udp_1</id> |
| 401 | <is-enabled>true</is-enabled> |
| 402 | </pg-stream> |
| 403 | <pg-stream> |
| 404 | <id>fw_udp_2</id> |
| 405 | <is-enabled>true</is-enabled> |
| 406 | </pg-stream> |
| 407 | <pg-stream> |
| 408 | <id>fw_udp_3</id> |
| 409 | <is-enabled>true</is-enabled> |
| 410 | </pg-stream> |
| 411 | <pg-stream> |
| 412 | <id>fw_udp_4</id> |
| 413 | <is-enabled>true</is-enabled> |
| 414 | </pg-stream> |
| 415 | <pg-stream> |
| 416 | <id>fw_udp_5</id> |
| 417 | <is-enabled>true</is-enabled> |
| 418 | </pg-stream> |
| 419 | </pg-streams> |
| 420 | </sample-plugin> |
| 421 | </config> |
| 422 | </edit-config> |
| 423 | </rpc> |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 424 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 425 | For creating day-2 configuration call the same endpoint and use the following payload: |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 426 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 427 | .. code-block:: JSON |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 428 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 429 | { |
| 430 | "actionIdentifiers": { |
| 431 | "mode": "sync", |
| 432 | "blueprintName": "pnf_netconf", |
| 433 | "blueprintVersion": "1.0.0", |
| 434 | "actionName": "config-assign" |
| 435 | }, |
| 436 | "payload": { |
| 437 | "config-assign-request": { |
| 438 | "resolution-key": "day-2", |
| 439 | "config-assign-properties": { |
| 440 | "stream-count": 10 |
| 441 | } |
| 442 | } |
| 443 | }, |
| 444 | "commonHeader": { |
| 445 | "subRequestId": "143748f9-3cd5-4910-81c9-a4601ff2ea58", |
| 446 | "requestId": "e5eb1f1e-3386-435d-b290-d49d8af8db4c", |
| 447 | "originatorId": "SDNC_DG" |
| 448 | } |
| 449 | } |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 450 | |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 451 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 452 | .. note:: |
| 453 | Until this step CDS did not interact with the PNF simulator or device. We just created the day-1 and day-2 |
| 454 | configurations and stored it in CDS database |
JakobKrieg | abfdc07 | 2020-10-06 16:49:39 +0200 | [diff] [blame] | 455 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 456 | **Config-Deploy:** |
JakobKrieg | abfdc07 | 2020-10-06 16:49:39 +0200 | [diff] [blame] | 457 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 458 | Now we will make the CDS REST API calls to push the day-1 and day-2 configuration changes to the PNF simulator. |
| 459 | Call the same `process` endpoint with the following payload: |
JakobKrieg | abfdc07 | 2020-10-06 16:49:39 +0200 | [diff] [blame] | 460 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 461 | .. code-block:: JSON |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 462 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 463 | { |
| 464 | "actionIdentifiers": { |
| 465 | "mode": "sync", |
| 466 | "blueprintName": "pnf_netconf", |
| 467 | "blueprintVersion": "1.0.0", |
| 468 | "actionName": "config-deploy" |
| 469 | }, |
| 470 | "payload": { |
| 471 | "config-deploy-request": { |
| 472 | "resolution-key": "day-1", |
| 473 | "pnf-ipv4-address": "127.17.0.2", |
| 474 | "netconf-username": "netconf", |
| 475 | "netconf-password": "netconf" |
| 476 | } |
| 477 | }, |
| 478 | "commonHeader": { |
| 479 | "subRequestId": "143748f9-3cd5-4910-81c9-a4601ff2ea58", |
| 480 | "requestId": "e5eb1f1e-3386-435d-b290-d49d8af8db4c", |
| 481 | "originatorId": "SDNC_DG" |
| 482 | } |
| 483 | } |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 484 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 485 | Go back to PNF netopeer cli console like mentioned above and verify if you can see 5 streams fw_udp_1 to fw_udp_5 enabled. If the 5 streams |
| 486 | appear in the output as follows, the day-1 configuration got successfully deployed and the use case is successfully done. |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 487 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 488 | .. code-block:: sh |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 489 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 490 | > get --filter-xpath /sample-plugin:* |
| 491 | DATA |
| 492 | <sample-plugin xmlns="urn:opendaylight:params:xml:ns:yang:sample-plugin"> |
| 493 | <pg-streams> |
| 494 | <pg-stream> |
| 495 | <id>1</id> |
| 496 | <is-enabled>true</is-enabled> |
| 497 | </pg-stream> |
| 498 | <pg-stream> |
| 499 | <id>fw_udp_1</id> |
| 500 | <is-enabled>true</is-enabled> |
| 501 | </pg-stream> |
| 502 | <pg-stream> |
| 503 | <id>fw_udp_2</id> |
| 504 | <is-enabled>true</is-enabled> |
| 505 | </pg-stream> |
| 506 | <pg-stream> |
| 507 | <id>fw_udp_3</id> |
| 508 | <is-enabled>true</is-enabled> |
| 509 | </pg-stream> |
| 510 | <pg-stream> |
| 511 | <id>fw_udp_4</id> |
| 512 | <is-enabled>true</is-enabled> |
| 513 | </pg-stream> |
| 514 | <pg-stream> |
| 515 | <id>fw_udp_5</id> |
| 516 | <is-enabled>true</is-enabled> |
| 517 | </pg-stream> |
| 518 | </pg-streams> |
| 519 | </sample-plugin> |
| 520 | > |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 521 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 522 | The same can be done for day-2 config (follow same steps just with day-2 in payload). |
JakobKrieg | 0f29c1c | 2020-10-01 14:00:40 +0200 | [diff] [blame] | 523 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 524 | .. note:: |
| 525 | Through deployment we did not deploy the PNF, we just modified the PNF. The PNF could also be installed by CDS |
| 526 | but this is not targeted in this guide. |
JakobKrieg | abfdc07 | 2020-10-06 16:49:39 +0200 | [diff] [blame] | 527 | |
| 528 | |
| 529 | Creators of this guide |
| 530 | ~~~~~~~~~~~~~~~~~~~~~~~ |
| 531 | |
| 532 | Deutsche Telekom AG |
| 533 | |
| 534 | Jakob Krieg (Rocketchat @jakob.Krieg); Eli Halych (Rocketchat @elihalych) |
| 535 | |
JakobKrieg | fac42cc | 2020-11-06 19:17:56 +0100 | [diff] [blame^] | 536 | This guide is a derivate from https://wiki.onap.org/display/DW/PNF+Simulator+Day-N+config-assign+and+config-deploy+use+case. |