VNFRQTS How to use PlantUML
Introduction
Starting El Alto, the VNF Requirements Project requires all diagrams within the project to use PlantUML instead of injecting images of diagrams for re-usability. For detailed documentation on how to use PlantUML, please refer to http://plantuml.com/.
Testing PlantUML syntax
There are a multitude of ways to create PlantUML diagrams and test them out:
For a simple web text editor we recommend: https://www.planttext.com/
You can also test out the PlantUML syntax in confluence using the "PlantUML Macro" available.
Testing PlantUML in ReadTheDocs
To test how the PlantUML would be rendered in the project there are a few steps to take once you have cloned the repository down.
Adding PlantUML to RST
When you are adding the PlantUML to RST you will start with the directive "uml".
What this looks like:
.. uml::
Next, you can add a caption and alignment.
What this looks like:
.. uml::
:align: center
:caption: **Scale Out Sequence Diagram** - Design Time
Then you would paste in the PlantUML text (make sure the spacing is correct, look at example below).
Example in RST:
PlantUML text in RST
Diagram rendered
Example in Confluence:
PlantUML text
Diagram rendered
@startuml
title Message Style - Scale Out Sequence Diagram - Design Time
skinparam sequenceMessageAlign center
Participant "Service Designer" as SD
Participant SDC
Participant CLAMP
Participant CDT
Participant APPC
Participant SDNC
Participant Policy
Participant SO
Participant DCAE
SD -> SDC: Onboarding Package
SD -> SDC: Set Scaling Parameters
SDC -> SO: Send Heat Templates and Image Files
SDC -> SDNC: Send Heat Templates and Image Files
SDC -> SDNC: Send Preload files
SDC -> DCAE: Threshold Scaling Events
SD -> CLAMP: Gaurd Policies
SD -> CLAMP: Operational Policies
SD -> CLAMP: Configuration Data
CLAMP -> Policy: Send Policies to Policy Engine Including VNF Configuration Data and VF_Module Name
SD -> CDT: Parameter definition template for each LCM action (ConfigScaleOut, Healthcheck)
CDT -> APPC: Save Parameter Definition Template to APPC
@enduml
Rendering diagram locally
To render the diagram locally you would run "tox -e docs" as you would normally, but you need to make a few small changes.
Prerequisites to run locally
Download the latest PlantUML Jar file from: http://plantuml.com/download
Go into the "conf.py" file and add the following line:
plantuml = 'java -jar /path/to/plantuml.jar'
Where the "/path/to/plantuml.jar" is the full path of where you downloaded the Jar file in step 1.
Run "tox -e docs" and make sure the diagram has rendered properly.
For any questions, concerns or help please contact: @Hagop Bozawglanian