Bump to odlparent 3.1.0 and yangtools 2.0.3
[alto.git] / alto-extensions / simple-pce / UserGuide.md
1 # ALTO SPCE (Simple Path Computation Engine) User Guide
2
3 The ALTO SPCE module provides a simple path computation engine for ALTO and other projects. It works in the
4 OpenDaylight(ODL) SDN Controller.
5
6 ## Step 1. Download alto-spce kar
7
8 ```
9 $ wget https://github.com/snlab/alto-spce/releases/download/1.0.0/alto-spce-features-1.0.0-SNAPSHOT.kar
10 ```
11
12 ## Step 2. Deploy alto-spce into a running OpenDaylight controller
13 ```
14 $ DISTRO_DIR=<odl_distribution_directory>
15 $ cp alto-spce-features-1.0.0-SNAPSHOT.kar $DISTRO_DIR/deploy/
16 $ mkdir tmp
17 $ unzip alto-spce-features-1.0.0-SNAPSHOT.kar -d tmp
18 $ cp -r tmp/repository/org $DISTRO_DIR/system/
19 $ rm -rf tmp
20 ```
21
22 ## Sept 3. Install the newer version of python-odl to include the two alto-spce methods:
23 ```
24 $ git clone https://github.com/snlab/python-odl
25 $ cd python-odl
26 $ sudo python setup.py install
27 ```
28
29 ## Step 4. Run python-odl
30 ```
31 $ python
32 >>> import odl.instance
33 >>> import odl.altospce
34
35 # setup server
36 >>> serverURL = "http://140.221.143.143:8080"
37 >>> myodl = odl.instance.ODLInstance(serverURL, ("admin", "admin"))
38 >>> myaltospce = odl.altospce.ALTOSpce(server=serverURL, credentials=("admin", "admin"), odl_instance=myodl)
39
40 # Set up a path
41 >>> srcIP = "198.188.136.11"
42 >>> dstIP = "198.188.136.21"
43 >>> mypath = myaltospce.path_setup(src=srcIP, dst=dstIP, objective_metrics=["hopcount"], constraint_metric=[{"metric": "hopcount", "min": 1, "max": 3}])
44
45 # This command should return the path setup. To see it, 
46 >>> print mypath['path']
47 # You should see something like ["198.188.136.11|openflow:365545302388672:185|198.188.136.21",  "198.168.136.21|openflow:365545302388672:185|198.168.136.11"]
48
49 # Remove the path setup above, for example, after showing the path on UI,
50 >>> myaltospce.path_remove(mypath['path'])
51 ```