1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. (c) <optionally add copywriters name>
7 Parser tosca2heat Execution
8 ===========================
10 Step 1: Change directory to where the tosca yaml files are present, example is
11 below with vRNC definiton.
15 cd parser/tosca2heat/tosca-parser/toscaparser/extensions/nfv/tests/data/vRNC/Definitions
18 Step 2: Run the python command heat-translator with the TOSCA yaml file as an input option.
22 heat-translator --template-file=<input file> --template-type=tosca
23 --outpurt-file=<output hot file>
29 heat-translator --template-file=vRNC.yaml \
30 --template-type=tosca --output-file=vRNC_hot.yaml
32 **Notes**: heat-translator will call class of ToscaTemplate in tosca-parser firstly to validate and
33 parse input yaml file, then tranlate the file into hot file, if you only want to validate or
34 check the input file and don't want to translate, please use tosaca-parser as following:
38 tosca-parser --template-file=<path to the YAML template> [--nrpv] [--debug]
40 tosca-parser --template-file=<path to the CSAR zip file> [--nrpv] [--debug]
42 tosca-parser --template-file=<URL to the template or CSAR> [--nrpv] [--debug]
44 --nrpv Ignore input parameter validation when parse template.
45 --debug debug mode for print more details other than raise exceptions when errors happen
51 tosca-parser --template-file=vRNC.yaml --nrpv
53 Parser tosca2heat References
54 ============================
55 Refer two upstream components:
56 https://github.com/openstack/tosca-parser/blob/master/doc/source/usage.rst
57 https://github.com/openstack/heat-translator/blob/master/doc/source/usage.rst
62 Parser yang2tosca Execution
63 ===========================
65 Step 1: Change directory to where the scripts are present.
71 Step 2: Copy the YANG file which needs to be converted into TOSCA to
72 current (parser/yang2tosca) folder.
74 Step 3: Run the python script "parser.py" with the YANG file as an input option.
78 python parser.py -n "YANG filename"
84 python parser.py -n example.yaml
86 Step 4: Verify the TOSCA YAMl which file has been created with the same name
87 as the YANG file with a “_tosca” suffix.
91 cat "YANG filename_tosca.yaml"
97 cat example_tosca.yaml
103 Parser policy2tosca Execution
104 =============================
106 Step 1: To see a list of commands available.
112 Step 2: To see help for an individual command, include the command name on the command line
116 policy2tosca help <service>
118 Step 3: To inject/remove policy types/policy definitions provide the TOSCA file as input to
119 policy2tosca command line.
123 policy2tosca <service> [arguments]
129 policy2tosca add-definition \
130 --policy_name rule2 --policy_type tosca.policies.Placement.Geolocation \
131 --description "test description" \
132 --properties region:us-north-1,region:us-north-2,min_inst:2 \
133 --targets VNF2,VNF4 \
134 --metadata "map of strings" \
135 --triggers "1,2,3,4" \
136 --source example.yaml
139 Step 4: Verify the TOSCA YAMl updated with the injection/removal executed.
143 cat "<source tosca file>"
149 cat example_tosca.yaml
152 Parser verigraph Execution
153 ==========================
155 VeriGraph is accessible via both a RESTful API and a gRPC interface.
159 Step 1. Change directory to where the service graph examples are present
163 cd parser/verigraph/examples
165 Step 2. Use a REST client (e.g., cURL) to send a POST request (whose body is one of the JSON
166 file in the directory)
170 curl -X POST -d @<file_name>.json http://<server_address>:<server_port>/verify/api/graphs
171 --header "Content-Type:application/json"
173 Step 3. Use a REST client to send a GET request to check a reachability-based property between
174 two nodes of the service graph created in the previous step.
178 curl -X GET http://<server_addr>:<server_port>/verify/api/graphs/<graphID>/
179 policy?source=<srcNodeID>&destination=<dstNodeID>&type=<propertyType>
183 - <graphID> is the identifier of the service graph created at Step 2
184 - <srcNodeID> is the name of the source node
185 - <dstNodeID> is the name of the destination node
186 - <propertyType> can be ``reachability``, ``isolation`` or ``traversal``
188 Step 4. the output is a JSON with the overall result of the verification process and the partial
189 result for each path that connects the source and destination nodes in the service graph.
193 VeriGraph exposes a gRPC interface that is self-descriptive by its Protobuf file
194 (``parser/verigraph/src/main/proto/verigraph.proto``). In the current release, Verigraph
195 misses a module that receives service graphs in format of JSON and sends the proper
196 requests to the gRPC server. A testing client has been provided to have an example of how
197 to create a service graph using the gRPC interface and to trigger the verification step.
199 1. Run the testing client
204 #Client souce code in ``parser/verigraph/src/it/polito/verigraph/grpc/client/Client.java``
205 ant -f buildVeriGraph_gRPC.xml run-client