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=<input yaml file>
44 tosca-parser --template-file=vRNC.yaml
46 Parser tosca2heat References
47 ============================
48 Refer two upstream components:
49 https://github.com/openstack/tosca-parser/blob/master/doc/source/usage.rst
50 https://github.com/openstack/heat-translator/blob/master/doc/source/usage.rst
55 Parser yang2tosca Execution
56 ===========================
58 Step 1: Change directory to where the scripts are present.
64 Step 2: Copy the YANG file which needs to be converted into TOSCA to
65 current (parser/yang2tosca) folder.
67 Step 3: Run the python script "parser.py" with the YANG file as an input option.
71 python parser.py -n "YANG filename"
77 python parser.py -n example.yaml
79 Step 4: Verify the TOSCA YAMl which file has been created with the same name
80 as the YANG file with a “_tosca” suffix.
84 cat "YANG filename_tosca.yaml"
90 cat example_tosca.yaml
96 Parser policy2tosca Execution
97 =============================
99 Step 1: To see a list of commands available.
105 Step 2: To see help for an individual command, include the command name on the command line
109 policy2tosca help <service>
111 Step 3: To inject/remove policy types/policy definitions provide the TOSCA file as input to
112 policy2tosca command line.
116 policy2tosca <service> [arguments]
122 policy2tosca add-definition \
123 --policy_name rule2 --policy_type tosca.policies.Placement.Geolocation \
124 --description "test description" \
125 --properties region:us-north-1,region:us-north-2,min_inst:2 \
126 --targets VNF2,VNF4 \
127 --metadata "map of strings" \
128 --triggers "1,2,3,4" \
129 --source example.yaml
132 Step 4: Verify the TOSCA YAMl updated with the injection/removal executed.
136 cat "<source tosca file>"
142 cat example_tosca.yaml
145 Parser verigraph Execution
146 ==========================
148 VeriGraph is accessible via both a RESTful API and a gRPC interface.
152 Step 1. Change directory to where the service graph examples are present
156 cd parser/verigraph/examples
158 Step 2. Use a REST client (e.g., cURL) to send a POST request (whose body is one of the JSON
159 file in the directory)
163 curl -X POST -d @<file_name>.json http://<server_address>:<server_port>/verify/api/graphs
164 --header "Content-Type:application/json"
166 Step 3. Use a REST client to send a GET request to check a reachability-based property between
167 two nodes of the service graph created in the previous step.
171 curl -X GET http://<server_addr>:<server_port>/verify/api/graphs/<graphID>/
172 policy?source=<srcNodeID>&destination=<dstNodeID>&type=<propertyType>
176 - <graphID> is the identifier of the service graph created at Step 2
177 - <srcNodeID> is the name of the source node
178 - <dstNodeID> is the name of the destination node
179 - <propertyType> can be ``reachability``, ``isolation`` or ``traversal``
181 Step 4. the output is a JSON with the overall result of the verification process and the partial
182 result for each path that connects the source and destination nodes in the service graph.
186 VeriGraph exposes a gRPC interface that is self-descriptive by its Protobuf file
187 (``parser/verigraph/src/main/proto/verigraph.proto``). In the current release, Verigraph
188 misses a module that receives service graphs in format of JSON and sends the proper
189 requests to the gRPC server. A testing client has been provided to have an example of how
190 to create a service graph using the gRPC interface and to trigger the verification step.
192 1. Run the testing client
197 #Client souce code in ``parser/verigraph/src/it/polito/verigraph/grpc/client/Client.java``
198 ant -f buildVeriGraph_gRPC.xml run-client