Skip to content

Latest commit

 

History

History
409 lines (242 loc) · 13.9 KB

ovsdb_vsctl.md

File metadata and controls

409 lines (242 loc) · 13.9 KB

Module ovsdb_vsctl

Module providing APIs in lines similar to that of ovs-vsctl utility.

Authors: Vasu Dasari.

Data Types


table_name() = unicode:chardata()

table_params() = map()

tunnel_type() = gre | vxlan

vsctl_returns() = ok | error | {ok, term()} | {error, term()}

Function Index

set/4Set table entries in ovsdb.
get/4Get table entries in ovsdb.
set_controller/3Set Openflow Controller to Bridge.
del_controller/2Delete Openflow Controller from Bridge.
add_br/3Add/Modify a bridge to switch.
set_br/3Set bridge options.
get_br/2Get bridge info from switch.
get_br/3
del_br/2Deletes a bridge to switch.
add_port/3Add/modify port to a bridge.
set_port/3Set port parameters.
set_iface/3Set other interface parameters.
get_port/2Get port information.
get_port/3
get_iface/2Get interface information.
get_iface/3
get_ifaces_on_bridge/3Get all interfacdes on a bridge.
del_port/3Delete port from a bridge.
add_bond/4Create or modify bond interface.
set_bond/3Modify interface level parameters of a a bond port.
add_bond_iface/4Add an interface to a bond.
del_bond_iface/4Delete an interface to a bond.
del_bond/3Delete a bond port.
add_tunnel_port/5Add/Modify OVS Tunnel port.
del_tunnel_port/3Delete a tunnel port.
vsctl/2
trace/1

Function Details

set/4


Set table entries in ovsdb

This API is equivalent to executing command of form ovs-vsctl set Table Table Id Config Tuples ovs-vsctl set int vxlan1 type=vxlan

get/4


get(Table::table_name(), Key::table_key(), Columns::list(), Opts::ovsdb_client:opts()) -> vsctl_returns() | list() | map()

Get table entries in ovsdb

This API is equivalent to executing command of form ovs-vsctl --columns Columns list Table Table-Id

set_controller/3


set_controller(BrName::unicode:chardata(), Controller::unicode:chardata(), Opts::ovsdb_client:opts()) -> vsctl_returns()

Set Openflow Controller to Bridge

This is equivalant to $ ovs-vsctl set-controller br0 tcp:10.1.1.1:6653

del_controller/2


del_controller(BrName::unicode:chardata(), Opts::ovsdb_client:opts()) -> vsctl_returns()

Delete Openflow Controller from Bridge

This is equivalant to $ ovs-vsctl del-controller br0

add_br/3


add_br(BrName::unicode:chardata(), BrOptions::map(), Opts::ovsdb_client:opts()) -> vsctl_returns()

Add/Modify a bridge to switch

For the API to return ok, when the entry is already present, set may_exist option to true This is quivalent to $ ovs-vsctl --may-exist add-br br1 ...

set_br/3


set_br(BrName::table_key(), BrOptions::table_params(), Opts::ovsdb_client:opts()) -> vsctl_returns()

Set bridge options

This function will return error if bridge does not exist

get_br/2


get_br(BrName::table_key(), Opts::ovsdb_client:opts()) -> vsctl_returns()

Get bridge info from switch

This is quivalent to $ ovs-vsctl del-br br1 ...

get_br/3

get_br(BrName, Columns, Opts) -> any()

del_br/2


Deletes a bridge to switch

This is quivalent to $ ovs-vsctl del-br br1 ...

add_port/3


Add/modify port to a bridge

This is quivalent to $ ovs-vsctl add-port br1 br1-eth1 Options supported: Interface options: admin_state, ofport_request

set_port/3


set_port(PortName::table_key(), Params::table_params(), Opts::ovsdb_client:opts()) -> vsctl_returns()

Set port parameters

This function will return error if port does not exist

set_iface/3


set_iface(IfName::table_key(), Params::table_params(), Opts::ovsdb_client:opts()) -> vsctl_returns()

Set other interface parameters

This function will return error if interface does not exist

get_port/2


get_port(PortName::table_key(), Opts::ovsdb_client:opts()) -> vsctl_returns()

Get port information

Gets port information for PortName. To get information of all ports available use all option.

get_port/3

get_port(PortName, Columns, Opts) -> any()

get_iface/2

get_iface(IfName, Opts) -> any()

Get interface information

Gets interface information for IfName. To get information of all interfaces available use all option.

get_iface/3

get_iface(IfName, Columns, Opts) -> any()

get_ifaces_on_bridge/3


get_ifaces_on_bridge(BrName::table_key(), Columns::list(), Opts::ovsdb_client:opts()) -> vsctl_returns()

Get all interfacdes on a bridge

del_port/3


Delete port from a bridge

This is quivalent to $ ovs-vsctl del-port br1 br1-eth1

add_bond/4


add_bond(BrName::unicode:chardata(), BondName::unicode:chardata(), IfaceList::list(), Opts::ovsdb_client:opts()) -> ovsdb_client:rpc_return()

Create or modify bond interface

This is quivalent to $ ovs-vsctl --may-exist add-bond br1 br1-bond1 bond1-eth1 bond2-eth2... Options Supported: lacp bond_mode

set_bond/3


set_bond(BondName::table_key(), Params::table_params(), Opts::ovsdb_client:opts()) -> vsctl_returns()

Modify interface level parameters of a a bond port

This function fetches member links of the specified port and then applies the params on all those interfaces

add_bond_iface/4


add_bond_iface(BrName::unicode:chardata(), BondName::unicode:chardata(), Iface::list() | unicode:chardata(), Opts::ovsdb_client:opts()) -> ovsdb_client:rpc_return()

Add an interface to a bond

This is equivalent to: $ ovs-vsctl add-bond-iface br1 br1-eth1

del_bond_iface/4


del_bond_iface(BrName::unicode:chardata(), BondName::unicode:chardata(), Iface::list() | unicode:chardata(), Opts::ovsdb_client:opts()) -> ovsdb_client:rpc_return()

Delete an interface to a bond

This is equivalent to: $ ovs-vsctl del-bond-iface br1 br1-eth1

del_bond/3


Delete a bond port

This is equivalent to: $ ovs-vsctl del-bond br1 br1-bond1

add_tunnel_port/5


add_tunnel_port(BrName::table_key(), Name::unicode:chardata(), TunnelType::tunnel_type(), Params::table_params(), Opts::ovsdb_client:opts()) -> ovsdb_client:rpc_return()

Add/Modify OVS Tunnel port

This comand is equivalent to: $ ovs-vsctl add-port br0 a1_b1 --
set interface a1_b1 type=vxlan options:key=1 options:remote_ip=172.31.1.1 Options supported are: key, remote_ip, local_ip, dst_mac, src_mac, vlan_id, out_port

del_tunnel_port/3


Delete a tunnel port

vsctl/2

vsctl(Op, Opts) -> any()

trace/1

trace(X1) -> any()