ovs-vsctl的DB的操作

如果你在命令行里面找不到相应的命令创建和删除对象,则可以直接删除数据库

[−−if−exists] [−−columns=column[,column]...] list table [record]...

$ sudo ovs-vsctl list bridge
_uuid               : 91cd3178-fe2d-4004-85b6-f0f01fcc8b51
controller          : []
datapath_id         : "00007a31cd910440"
datapath_type       : ""
external_ids        : {}
fail_mode           : []
flood_vlans         : []
flow_tables         : {}
ipfix               : []
mirrors             : []
name                : helloother
netflow             : []
other_config        : {}
ports               : [20682bfb-ea46-497e-940f-43f48f00da84, 7dce6e3c-cedd-4bf0-b9dc-f8e90e8788c2, 83489fb4-f8c3-4a32-9bc4-b4cb484dd684]
protocols           : []
sflow               : []
status              : {}
stp_enable          : false

_uuid               : b491acba-c237-4942-94c8-14afad6d1a36
controller          : []
datapath_id         : "0000baac91b44249"
datapath_type       : ""
external_ids        : {}
fail_mode           : []
flood_vlans         : []
flow_tables         : {}
ipfix               : []
mirrors             : []
name                : hello
netflow             : []
other_config        : {}
ports               : [90a3fc08-5eea-4d69-bb00-c25250d94d33, bbdf854e-06d5-42f9-8074-98f608248860, c1a8c0f7-11c7-42fd-a272-0961a9aa6522, c5e0caca-5387-4e19-b4d5-25c58eb1257c, e7b71762-f0ac-4cf9-afb6-686e10c23518]
protocols           : []
sflow               : []
status              : {}
stp_enable          : false

[−−columns=column[,column]...] find table [column[:key]=value]...

$ sudo ovs-vsctl find port name=first_br
_uuid               : c5e0caca-5387-4e19-b4d5-25c58eb1257c
bond_downdelay      : 0
bond_fake_iface     : false
bond_mode           : []
bond_updelay        : 0
external_ids        : {}
fake_bridge         : false
interfaces          : [b0645fc3-c977-42ca-a234-5e84f1a9801a]
lacp                : []
mac                 : []
name                : first_br
other_config        : {}
qos                 : ce7cfd43-8369-4ce6-a7fd-4e0b79307c10
statistics          : {}
status              : {}
tag                 : []
trunks              : []
vlan_mode           : []

[−−if−exists] [−−columns=column[,column]...] list table [record]...

  • Lists the data in each specified record. If no records are specified, lists all the records in table.
  • If −−columns is specified, only the requested columns are listed, in the specified order. Otherwise, all columns are listed, in alphabetical order by column name.
  • Without −−if-exists, it is an error if any specified record does not exist. With −−if-exists, the command ignores any record that does not exist, without producing any output.

[−−columns=column[,column]...] find table [column[:key]=value]...

  • Lists the data in each record in table whose column equals value or, if key is specified, whose column contains a key with the specified value.
  • The following operators may be used where = is written in the syntax summary: = != < > <= >=

[−−if−exists] [−−id=@name] get table record [column[:key]]...

  • Prints the value of each specified column in the given record in table. For map columns, a key may optionally be specified, in which case the value associated with key in the column is printed, instead of the entire map.
  • Without −−if−exists, it is an error if record does not exist or key is specified, if key does not exist in record. With −−if−exists, a missing record yields no output and a missing key prints a blank line.
  • If @name is specified, then the UUID for record may be referred to by that name later in the same ovs−vsctl invocation in contexts where a UUID is expected.
  • Both −−id and the column arguments are optional, but usually at least one or the other should be specified. If both are omitted, then get has no effect except to verify that record exists in table.
  • −−id and −−if−exists cannot be used together.

[−−if−exists] set table record column[:key]=value...

  • Sets the value of each specified column in the given record in table to value. For map columns, a key may optionally be specified, in which case the value associated with key in that column is changed (or added, if none exists), instead of the entire map.
  • Without −−if-exists, it is an error if record does not exist. With −−if-exists, this command does nothing if record does not exist.

[−−if−exists] add table record column [key=]value...

  • Adds the specified value or key-value pair to column in record in table. If column is a map, then key is required, otherwise it is prohibited. If key already exists in a map column, then the current value is not replaced (use the set command to replace an existing value).
  • Without −−if-exists, it is an error if record does not exist. With −−if-exists, this command does nothing if record does not exist.

[−−if−exists] remove table record column value...

[−−if−exists] remove table record column key...

[−−if−exists] remove table record column key=value...

  • Removes the specified values or key-value pairs from column in record in table. The first form applies to columns that are not maps: each specified value is removed from the column. The second and third forms apply to map columns: if only a key is specified, then any key-value pair with the given key is removed, regardless of its value; if a value is given then a pair is removed only if both key and value match.
  • It is not an error if the column does not contain the specified key or value or pair.
  • Without −−if-exists, it is an error if record does not exist. With −−if-exists, this command does nothing if record does not exist.

[−−if−exists] clear table record column...

  • Sets each column in record in table to the empty set or empty map, as appropriate. This command applies only to columns that are allowed to be empty.
  • Without −−if-exists, it is an error if record does not exist. With −−if-exists, this command does nothing if record does not exist.

[−−id=@name] create table column[:key]=value...

  • Creates a new record in table and sets the initial values of each column. Columns not explicitly set will receive their default values. Outputs the UUID of the new row.
  • If @name is specified, then the UUID for the new row may be referred to by that name elsewhere in the same ovs−vsctl invocation in contexts where a UUID is expected. Such references may precede or follow the create command.
  • Records in the Open vSwitch database are significant only when they can be reached directly or indirectly from the Open_vSwitch table. Except for records in the QoS or Queue tables, records that are not reachable from the Open_vSwitch table are automatically deleted from the database. This deletion happens immediately, without waiting for additional ovs−vsctl commands or other database activity. Thus, a create command must generally be accompanied by additional commands within the same ovs−vsctl invocation to add a chain of references to the newly created record from the top-level Open_vSwitch record. The EXAMPLES section gives some examples that show how to do this.

[−−if−exists] destroy table record...

  • Deletes each specified record from table. Unless −−if−exists is specified, each records must exist.

−−all destroy table

  • Deletes all records from the table.
  • The destroy command is only useful for records in the QoS or Queue tables. Records in other tables are automatically deleted from the database when they become unreachable from the Open_vSwitch table. This means that deleting the last reference to a record is sufficient for deleting the record itself. For records in these tables, destroy is silently ignored. See the EXAMPLES section below for more information.

Openvswitch手册(8): ovs-vsctl的DB的操作的更多相关文章

  1. Openvswitch手册(1): 架构,SSL, Manager, Bridge

    Openvswitch是一个virutal swtich, 支持Open Flow协议,当然也有一些硬件Switch也支持Open Flow协议,他们都可以被统一的Controller管理,从而实现物 ...

  2. Openvswitch手册(2): OpenFlow Controller

         我们这一节主要来看Controller Controller有两种: Primary Controller: 真正控制vswitch的flow table,vswitch会保持和contro ...

  3. Openvswitch手册(4): Mirror

    这一节我们来分析Mirror Mirror就是配置一个bridge,将某些包发给指定的mirrored ports 对于包的选择: select_all,所有的包 select_dst_port se ...

  4. Openvswitch手册(9): Flow

    这一节我们将flow table flow table主要由ovs-ofctl命令操作 ovs-ofctl可以走和openflow controller一样的协议: ssl:ip[:port]: Th ...

  5. Openvswitch手册(3): sFlow, netFlow

    这一节,我们重点看sFlow 采样流sFlow(Sampled Flow)是一种基于报文采样的网络流量监控技术,主要用于对网络流量进行统计分析. sFlow系统包含一个嵌入在设备中的sFlow Age ...

  6. Openvswitch手册(5): VLAN and Bonding

    我们这一节来看Port 一般来说一个Port就是一个Interface,当然也有一个Port对应多个Interface的情况,成为Bond VLAN Configuration Port的一个重要的方 ...

  7. Openvswitch手册(6): QoS

    这一节我们看QoS,Qos的设置往往是和flow中的policy一起使用的 Open vSwitch QoS capabilities 1 Interface rate limiting 2 Port ...

  8. Openvswitch手册(7): Interfaces

    我们来看Interfaces ofport: OpenFlow port number for this interface. type: system: An ordinary network de ...

  9. laravel 控制器类DB类操作

    例子:TrGo表(trgo_chip): laravel框架建立:TrGoModel <?php namespace TrChaos\Model; class TrGoModel extends ...

随机推荐

  1. 关于@JsonIgnore的理解

    首先:@JsonIgnore是一个能够在后端发送给前端数据的时候对后端发送出的json字符串能够发挥作用的一个注解 如果比如user表,你在password这个属性上添加@JsonIgnore,就会s ...

  2. 1-蓝桥杯套路-java

    决定参加蓝桥杯用java了,当然得重新刷点题目,熟悉一下,以后要是考研失败了,可能回去找java的工作!!! 经验贴: 1. https://blog.csdn.net/wqy20140101/art ...

  3. 为什么text的值改变后onchange没有反应?

    onchange发生在元素失去焦点后,而不是想象中的元素的值发生改变的时候.其实它的作用就跟onblur(失去焦点事件)差不多,只不过onchange是失去焦点且值发生了改变.要想实现目的,可以改用o ...

  4. Angular实现动态添加删除表单输入框功能

    <div class="form-group form-group-sm" *ngFor="let i of login"> <label c ...

  5. vue项目运行

    共分为以下六步: 1.安装node.js2.安装cnpm3.安装vue-cli脚手架构建工具4.用vue-cli构建项目5.安装项目所需的依赖6.运行项目 第1步:从node.js官网下载node.j ...

  6. 关于mysql存储过程中传decimal值会自动四舍五入的这个坑

    容我说几句题外话:我的工作日常是用微软系的,SQL SERVICE 存储过程很强大,我也很习惯很喜欢用存储过程.和MySQL结缘,是在五年前,因为一些原因,公司要求用开源免费的数据库.很多时候,用my ...

  7. xbee PRO S2C的多固件烧写

    XBee and XBee-PRO ZB 嵌入式射频模块是与ZigBee/IEEE 802.15.4兼容的解决方案,可以满足低成本低功耗无线传感网络的特殊需求.该模块易于使用,极低的功耗,以及提供设备 ...

  8. shell脚本编写遍历某一目录下的所有文件

    遍历/root/321321/目录显示里面的所有文件 #!/bin/bash dir=`ls /root//` #定义遍历的目录 for i in $dir do echo $i done

  9. (转载)python 命名.py 不能与模块相同,否则会报错

    在学习python网页爬虫时,测试requests的post方法进行表单提交时,命名.py文件为requests.py 代码如下: import requests params={'firstname ...

  10. Java实现AES加密,异常java.security.InvalidKeyException: Illegal key size 的解决

    Java实现AES加密,抛出异常如下:java.security.InvalidKeyException: Illegal key size 代码参考 http://my.oschina.net/Ja ...