Merge "Added overview of Controller to developers guide."
[docs.git] / manuals / user-guide / src / main / asciidoc / vtn / VTN_How_To_view_STATIONS.adoc
1 ==== How To View Specific VTN Station Information.
2
3 This example demonstrates on how to view a specific VTN Station information.
4
5 .EXAMPLE DEMONSTRATING VTN STATIONS
6 image::vtn/vtn_stations.png[EXAMPLE DEMONSTRATING VTN STATIONS]
7
8 ===== Requirement
9 * Configure mininet and create a topology:
10
11 ----
12  $ sudo mn --custom /home/mininet/mininet/custom/topo-2sw-2host.py --controller=remote,ip=10.100.9.61 --topo mytopo
13 mininet> net
14
15  s1 lo:  s1-eth1:h1-eth0 s1-eth2:s2-eth1
16  s2 lo:  s2-eth1:s1-eth2 s2-eth2:h2-eth0
17  h1 h1-eth0:s1-eth1
18  h2 h2-eth0:s2-eth2
19 ----
20
21 * Generate traffic by pinging between hosts h1 and h2 after configuring the portmaps respectively
22
23
24 ----
25  mininet> h1 ping h2
26  PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
27  64 bytes from 10.0.0.2: icmp_req=1 ttl=64 time=16.7 ms
28  64 bytes from 10.0.0.2: icmp_req=2 ttl=64 time=13.2 ms
29 ----
30
31 ===== Configuration
32 .Create Controller
33
34 ----
35 curl -v --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"controller": {"controller_id": "controllerone", "ipaddr":"10.100.9.61", "type": "odc", "version": "1.0", "auditstatus":"enable"}}' http://127.0.0.1:8083/vtn-webapi/controllers.json
36 ----
37 .Create a VTN
38
39 ----
40 curl -v --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vtn" : {"vtn_name":"vtn1","description":"test VTN" }}' http://127.0.0.1:8083/vtn-webapi/vtns.json
41 ----
42 .Create a vBridge in the VTN
43
44 ----
45 curl -v --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vbridge" : {"vbr_name":"vBridge1","controller_id":"controllerone","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges.json
46 ----
47 .Create two Interfaces into the vBridge
48
49 ----
50 curl -v --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if1","description": "if_desc1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json
51 curl -v --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if2","description": "if_desc2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json
52 ----
53 .Configure two mappings on the interfaces
54
55 ----
56 curl -v --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:01-s1-eth1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces/if1/portmap.json
57 curl -v --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:02-s2-eth2"}}' http://17.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces/if2/portmap.json
58 ----
59 .Get the VTN stations information
60
61 ----
62 curl -v -X GET -H 'content-type: application/json' -H 'username: admin' -H 'password: adminpass' "http://127.0.0.1:8083/vtn-webapi/vtnstations?controller_id=controllerone&vtn_name=vtn1"
63 ----
64
65 ===== Verification
66
67 ----
68 curl -v -X GET -H 'content-type: application/json' -H 'username: admin' -H 'password: adminpass' "http://127.0.0.1:8083/vtn-webapi/vtnstations?controller_id=controllerone&vtn_name=vtn1"
69 {
70    "vtnstations": [
71        {
72            "domain_id": "(DEFAULT)",
73            "interface": {},
74            "ipaddrs": [
75                "10.0.0.2"
76            ],
77            "macaddr": "b2c3.06b8.2dac",
78            "no_vlan_id": "true",
79            "port_name": "s2-eth2",
80            "station_id": "178195618445172",
81            "switch_id": "00:00:00:00:00:00:00:02",
82            "vnode_name": "vBridge1",
83            "vnode_type": "vbridge",
84            "vtn_name": "vtn1"
85        },
86        {
87            "domain_id": "(DEFAULT)",
88            "interface": {},
89            "ipaddrs": [
90                "10.0.0.1"
91            ],
92            "macaddr": "ce82.1b08.90cf",
93            "no_vlan_id": "true",
94            "port_name": "s1-eth1",
95            "station_id": "206130278144207",
96            "switch_id": "00:00:00:00:00:00:00:01",
97            "vnode_name": "vBridge1",
98            "vnode_type": "vbridge",
99            "vtn_name": "vtn1"
100        }
101    ]
102 }
103 ----