From 457196231fb0d1df4842ac0e6bf8c10260dc9d0b Mon Sep 17 00:00:00 2001 From: "serena.spinoso" Date: Thu, 16 Mar 2017 16:18:24 +0100 Subject: Add verigraph documentation Add user guide and test usage documentation. Add examples of service graphs to use verigraph. Change-Id: I3e454e03fa2de99bad0761e3e4a0eab98f2e0b23 Signed-off-by: serena.spinoso (cherry picked from commit 7d6f6962fb9c5ff6d815241d5d15c86c4c6a501b) --- docs/release/userguide/feature.userguide.rst | 61 ++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 3 deletions(-) (limited to 'docs/release/userguide/feature.userguide.rst') diff --git a/docs/release/userguide/feature.userguide.rst b/docs/release/userguide/feature.userguide.rst index f1e1362..1113118 100644 --- a/docs/release/userguide/feature.userguide.rst +++ b/docs/release/userguide/feature.userguide.rst @@ -44,7 +44,7 @@ Example: tosca-parser --template-file=vRNC.yaml Parser tosca2heat References -=========================== +============================ Refer two upstream components: https://github.com/openstack/tosca-parser/blob/master/doc/source/usage.rst https://github.com/openstack/heat-translator/blob/master/doc/source/usage.rst @@ -53,7 +53,7 @@ Refer two upstream components: Parser yang2tosca Execution -============================ +=========================== Step 1: Change directory to where the scripts are present. @@ -94,7 +94,7 @@ Example: Parser policy2tosca Execution -============================ +============================= Step 1: To see a list of commands available. @@ -141,3 +141,58 @@ Example: cat example_tosca.yaml + +Parser verigraph Execution +========================== + +VeriGraph is accessible via both a RESTful API and a gRPC interface. + +**REST API** + +Step 1. Change directory to where the service graph examples are present + +.. code-block:: bash + + cd parser/verigraph/examples + +Step 2. Use a REST client (e.g., cURL) to send a POST request (whose body is one of the JSON +file in the directory) + +.. code-block:: bash + + curl -X POST -d @.json http://:/verify/api/graphs + --header "Content-Type:application/json" + +Step 3. Use a REST client to send a GET request to check a reachability-based property between +two nodes of the service graph created in the previous step. + +.. code-block:: bash + + curl -X GET http://:/verify/api/graphs// + policy?source=&destination=&type= + +where: + +- is the identifier of the service graph created at Step 2 +- is the name of the source node +- is the name of the destination node +- can be ``reachability``, ``isolation`` or ``traversal`` + +Step 4. the output is a JSON with the overall result of the verification process and the partial +result for each path that connects the source and destination nodes in the service graph. + +**gRPC API** + +VeriGraph exposes a gRPC interface that is self-descriptive by its Protobuf file +(``parser/verigraph/src/main/proto/verigraph.proto``). In the current release, Verigraph +misses a module that receives service graphs in format of JSON and sends the proper +requests to the gRPC server. A testing client has been provided to have an example of how +to create a service graph using the gRPC interface and to trigger the verification step. + +1. Run the testing client + +.. code-block:: bash + + cd parser/verigraph + #Client souce code in ``parser/verigraph/src/main/it/polito/grpc/Client.java`` + ant -f buildVeriGraph_gRPC.xml run-client -- cgit 1.2.3-korg