当前位置: 移动技术网 > IT编程>数据库>MSSQL > ovsdb-client下发配置基本操作

ovsdb-client下发配置基本操作

2019年01月07日  | 移动技术网IT编程  | 我要评论
测试vsctl 添加br1.结果为发送一个"method":"list_dbs"的请求2.返回数据库的名称3.根据返回的数据库名称,Open_vSwitch,发送“method”:“get_Schema”请求4.获取生成该数据库“Open_vSwitch”的Schema5.发送“method”:“transact”请求,查询数据库Open_vSwitch中的Birdge表的各个状态6....

测试vsctl 添加br
1.结果为发送一个"method":"list_dbs"的请求
2.返回数据库的名称
3.根据返回的数据库名称,Open_vSwitch,发送“method”:“get_Schema”请求
4.获取生成该数据库“Open_vSwitch”的Schema
5.发送“method”:“transact”请求,查询数据库Open_vSwitch中的Birdge表的各个状态
6.返回各项值

测试vsctl 添加port
1.结果为发送一个"method":"get_schema"的请求,此时发送查询的数据库为_Server
2.返回_Server的Schema格式
3.发送“method”:“monitor_cond”请求,请求监控四张表的列
4.返回各列的结果

//插入一行数据并覆盖一个数据
ovsdb-client transact -v ‘[“Open_vSwitch”,{“op”:“insert”,“table”:“Baicells_Route”,“row”:{},“uuid-name”:“newrow”},{“op”:“update”,“table”:“Baicells_Vrf”,“where”:[["_uuid","",[“uuid”,“59b79a1d-20d1-47eb-a849-0ce5fb0bc24a”]]],“row”:{“route”:[“named-uuid”,“newrow”]}}]’
//插入新行
ovsdb-client transact -v '[“Open_vSwitch”,{“op”:“insert”,“table”:“Baicells_Route”,“row”:{“table”:“ddssss”},“uuid-name”:“newrow”},{“op”:“update”,“table”:“Baicells_Vrf”,“where”:[["_uuid","
",[“uuid”,“59b79a1d-20d1-47eb-a849-0ce5fb0bc24a”]]],“row”:{“route”:[“set”,[[“named-uuid”,“newrow”],[“uuid”,“6eb0ae60-90df-45f5-a821-8c71622f5d05”]]]}}]’
//
ovsdb-client transact -v ‘[“Open_vSwitch”,{“op”:“insert”,“table”:“Baicells_Route”,“row”:{“table”:“xxxx”},“uuid-name”:“newrow”},{“op”:“mutate”,“table”:“Baicells_Vrf”,“where”:[["_uuid","",[“uuid”,“59b79a1d-20d1-47eb-a849-0ce5fb0bc24a”]]],“mutations”:[[“route”,“insert”,[“set”,[[“named-uuid”,“newrow”]]]]]}]’
//删除新行
ovsdb-client transact -v '[“Open_vSwitch”,{“op”:“delete”,“table”:“Baicells_Route”,“where”:[["_uuid","
",[“uuid”,“9287a201-2fb0-4bfa-98b9-a76fb0310969”]]]},{“op”:“mutate”,“table”:“Baicells_Vrf”,“where”:[["_uuid","",[“uuid”,“a5227b0b-fc38-4d75-bce6-aafa3f56f499”]]],“mutations”:[[“route”,“delete”,[“set”,[[“named-uuid”,“newrow”]]]]]}]’
ovsdb-client list_dbs 该命令是列出存在数据库、
ovsdb-client get_schema 该命令是获取生成数据库的Schema
ovsdb-client transact 该命令是提交一系列的数据库事务
transact 中的基本操作有
1.insert
ovsdb-client transact ‘[“Open_vSwitch”,{“op”:“insert”,“table”:“Open_vSwitch”,“row”:{“name”:“xxx”,…}}]’ //向Open_vSwitch数据库中的“Open_vSwitch”表中插入一行数据
2.select
ovsdb-client transact '[“Open_vSwitch”,{“op”:“select”,“table”:“Open_vSwitch”,“where”:[[“name”,"
",“xxx”]]}]’ //查询数据库Open_vSwitch表中的name == xxx 的一行数据
3.update
ovsdb-client transact ‘[“Open_vSwitch”,{“op”:“update”,“table”:“Open_vSwitch”,“where”:[[“name”,"",“xxx”]],“row”:{“name”:“sss”}}]’
4.delete
ovsdb-client transact '[“Open_vSwitch”,{“op”:“delete”,“table”:“Open_vSwitch”,“where”:[[“name”,"
",“xxx”]]}]’
5.wait 没试出来是干嘛的,感觉和select差不多,返回rows指定的结果集
ovsdb-client transact ‘[“Open_vSwitch”,{“op”:“wait”,“table”:“Baicells_Vrf”,“where”:[],“columns”:[“name”],“until”:"==",“rows”:[]}]’
6.Commit

7.abort 事务终止时返回错误,对测试有用

8.Comment

9.Assert 事务没有加锁,则终止

ovsdb-client Cancel 该命令是当事务发送给服务器 即transact后,取消事务的发送

ovsdb-client
{“where”:[["_uuid","",[“uuid”,“712c9743-3f97-4c5b-8385-a971a660ab95”]]],“table”:“Open_vSwitch”,“op”:“update”,“row”:{“bridges”:[“set”,[[“uuid”,“010a7747-9e4b-4141-a0a3-91ca2dafb322”],[“uuid”,“1c4b47cc-5879-40fc-84dd-2f03448f62f0”],[“uuid”,“b8e13ed7-10bf-41e4-a5d5-026ea33d68cc”]]]}},{“mutations”:[[“next_cfg”,"+=",1]],“where”:[["_uuid","",[“uuid”,“712c9743-3f97-4c5b-8385-a971a660ab95”]]],“table”:“Open_vSwitch”,“op”:“mutate”}
删除啊,先update根表,再delete子表
或者mutate后delete子表
ovsdb-client -v transact '[“Open_vSwitch,”{“op”:“mutate”,“table”:“Baicells_Vrf”,“where”:[["_uuid","==",[“uuid”,“a5227b0b-fc38-4d75-bce6-aafa3f56f499”]]],“mutations”:[[“route”,“delete”,[“set”,[[“uuid”,“aa2a5c59-be37-4ffd-8a25-b4b2cdb9eb5f”]]]]]}]

本文地址:https://blog.csdn.net/chen739481102/article/details/85988113

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网