Skip to content

Commit a6dd232

Browse files
committed
readme: update and add demo
Signed-off-by: Adrian Moreno <[email protected]>
1 parent 55a6356 commit a6dd232

File tree

2 files changed

+57
-47
lines changed

2 files changed

+57
-47
lines changed

README.md

+57-47
Original file line numberDiff line numberDiff line change
@@ -8,62 +8,72 @@ This repository contains two programs:
88

99
The whole idea of this project is to test / demonstrate the goodies of the improvements that are being developed in go-ovn and libovsdb.
1010

11-
## How to use it
12-
Generate the native go-ovn model:
11+
## ovnmon
12+
### Building ovnmon
13+
By default, ovnmon uses the *ovn-nb.ovsschema* provided in the repo will be used. If you want to use your own,
14+
simply download it from your ovsdb server and replace the existing one
1315

14-
make model
16+
ovsdb-client get-schema ${SERVER} ${DATABASE} > ovn-nb.ovsschema
1517

16-
This will use the *ovn-nb.ovsschema* provided in the repo. If you want to use your own schema run:
18+
Then, just build the programs
19+
20+
make
21+
22+
This will use modelgen to generate a native model of the DB and use it to build ovnmon
23+
24+
25+
### Using ovnmon
26+
Usage of ovnmon:
27+
28+
./bin/ovnmon [FLAGS] [COMMAND]
29+
FLAGS:
30+
-auto
31+
Autostart: If set to true, it will start monitoring from the begining
32+
-db string
33+
Database connection. Default: unix:/${OVS_RUNDIR}/ovnnb_db.sock
34+
COMMAND:
35+
If provided, it will run the command and exit. If not, it will enter interactive mode
36+
For a full description of available commands use the command 'help'
1737

18-
make modelgen
19-
ovsdb-client get-schema ${SERVER} ${DATABASE} > myDB.ovsschema
20-
./bin/modelgen -o model -p model myDB.ovsschema
2138

22-
Build the simple monitoring app:
39+
By default it will open an interactive terminal where you can monitor the activity of the DB and inspect it:
2340

24-
make
41+
./bin/ovnmon --db tcp:172.19.0.4:6641
42+
OVN Monitoring Shell
43+
>>> help
2544

26-
Run the app against the database:
45+
Commands:
46+
clear clear the screen
47+
exit exit the program
48+
help display help
49+
list List the content of a specific table
50+
show Print available tables
51+
start Start monitoring activity of the OVN DB
52+
stop Stop monitoring activity of the OVN DB
2753

28-
./bin/ovnmon --db tcp:172.18.0.4:6641
2954

3055
The result looks like this:
3156

32-
A "Logical_Switch" has been added!
33-
&model.LogicalSwitch{
34-
UUID: "421d4947-0ea0-4f00-b412-b11f46664e4b",
35-
Acls: []string{
36-
"3bc7d4ff-955d-4abd-843a-a46684c053bd",
37-
},
38-
ExternalIds: map[string]string{},
39-
LoadBalancer: []string{
40-
"243fc1d3-2eef-4da2-8853-d57389e63881",
41-
"5d5f5d9c-0c28-4565-b288-747d69058f9f",
42-
"7ef402bf-a4b3-4f5e-8faa-9b4ee8e30578",
43-
"803a08dd-9fa5-4d7d-8f79-bdb36e7fe007",
44-
"9c70db1c-4254-4825-ad1a-969d32fd860e",
45-
"c3c7d07e-ee86-4b73-abc6-665a83f791c2",
46-
},
47-
DnsRecords: []string{},
48-
ForwardingGroups: []string{},
49-
Name: "ovn-control-plane",
50-
OtherConfig: map[string]string{
51-
"subnet": "10.244.1.0/24",
52-
},
53-
Ports: []string{
54-
"680148d5-f99f-4330-9d30-937caae8318c",
55-
"f2d58d9c-9832-41b5-a30f-19710dcc7c1b",
56-
},
57-
QosRules: []string{},
58-
}
59-
A "Address_Set" has been added!
60-
&model.AddressSet{
61-
UUID: "6e8efd17-8377-4ce7-907f-5d40fad3b845",
62-
Addresses: []string{},
63-
ExternalIds: map[string]string{
64-
"name": "kube-public_v4",
65-
},
66-
Name: "a18363165982804349389",
67-
}
57+
![Demo](doc/images/demo.gif)
6858

6959

60+
## modelgen
61+
### Building modelgen
62+
63+
make modelgen
64+
65+
### Using modelgen
66+
modelgen can be used to generate a model of any OVSDB database:
67+
68+
Usage of modelgen:
69+
modelgen [flags] OVS_SCHEMA
70+
Flags:
71+
-d Dry run
72+
-o string
73+
Directory where the generated files shall be stored (default ".")
74+
-p string
75+
Package name (default "modelgen")
76+
77+
### Example
78+
79+
./bin/modelgen -o model -p model myDB.ovsschema

doc/images/demo.gif

930 KB
Loading

0 commit comments

Comments
 (0)