digitalocean / go-openvswitch

Go packages which enable interacting with Open vSwitch and related tools. Apache 2.0 Licensed.
Other
295 stars 95 forks source link

ovsdb: make params an interface for more type flexibility #30

Closed mdlayher closed 6 years ago

mdlayher commented 6 years ago

Some RPCs use really weird requests, e.g.

write: {"id":"1","method":"transact","params":["Open_vSwitch",{"op":"select","table":"Bridge","where":[["name","==","ovsbr0"]]}]}
 read: {"id":"1","result":[{"rows":[{"name":"ovsbr0","flood_vlans":["set",[]],"netflow":["set",[]],"mirrors":["set",[]],"_uuid":["uuid","4bd512ea-5c3b-488d-b4dc-305f38911210"],"status":["map",[]],"datapath_id":"0000ea12d54b8d48","controller":["set",[]],"_version":["uuid","4ff1a3db-83eb-4df3-a8cb-2366d4a85af0"],"ipfix":["set",[]],"protocols":["set",[]],"fail_mode":["set",[]],"ports":["uuid","003fd088-02b9-406f-9894-19ec15d4da13"],"flow_tables":["map",[]],"other_config":["map",[]],"datapath_type":"","sflow":["set",[
 read: ]],"external_ids":["map",[]],"stp_enable":false}]}],"error":null}

We need the flexibility of empty interface on its own or otherwise that params array gets nested in a second one.

nicboul commented 6 years ago

LGTM