Re: [ovs-discuss] Can't add a row into a table with ovsdb-client

2017-11-14 Thread Ben Pfaff
On Tue, Nov 14, 2017 at 09:28:31PM -0500, Scott Reeve wrote:
> At this point, I would be fine to just add an empty row.
> 
> RFC shows this:
> ---
> 
> 5.2.1 .  Insert
> 
>The "insert" object contains the following members:
> 
>   "op": "insert"  required
>   "table": required
>   "row": required
>   "uuid-name":optional
> 
> 
> The operation inserts "row" into "table".  If "row" does not specify
>values for all the columns in "table", those columns receive default
>values.
> 
> ---
> 
> 
> 
> That seems to indicate that "row" doesn't need any values after it -
> not sure how to code that.

Use {}.
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


Re: [ovs-discuss] Can't add a row into a table with ovsdb-client

2017-11-14 Thread Scott Reeve
At this point, I would be fine to just add an empty row.

RFC shows this:
---

5.2.1 .  Insert

   The "insert" object contains the following members:

  "op": "insert"  required
  "table": required
  "row": required
  "uuid-name":optional


The operation inserts "row" into "table".  If "row" does not specify
   values for all the columns in "table", those columns receive default
   values.

---



That seems to indicate that "row" doesn't need any values after it -
not sure how to code that.


sudo ovsdb-client transact tcp:10.100.52.92:6640 '["hardware_vtep",
{"op":"insert", "table":"Ucast_Macs_Local", "row":{""}}]'


doesn't work.




On Tue, Nov 14, 2017 at 2:40 PM, Scott Reeve 
wrote:

> Tried a whole bunch of things but none seem to work.
> There is one db: "hardware_vtep"
> One of the tables is Ucast_Macs_Local:
>
>
> "Ucast_Macs_Local": {
>   "columns": {
> "MAC": {
>   "type": "string"},
> "ipaddr": {
>   "type": "string"},
> "locator": {
>   "type": {
> "key": {
>   "refTable": "Physical_Locator",
>   "type": "uuid"}}},
> "logical_switch": {
>   "type": {
> "key": {
>   "refTable": "Logical_Switch",
>   "type": "uuid",
>   "isRoot": true},
>
> I want to add one row into this table.
> Does "key" being present mean that the key is required?  Are there two
> keys for Ucast_Macs_Local?
>
> Here's an example of what I've tried:
> sudo ovsdb-client transact tcp:10.100.52.92:6640 '["hardware_vtep",
> {"op":"insert", "table":"Ucast_Macs_Local", "row":{"Logical_Switch":"
> 889240b8-13df-42cb-a733-18efe90aaf72"}}]'
>
> The syntax of the schema has me quite confused.
>
> Any suggestions are greatly appreciated.
>
>
>
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


Re: [ovs-discuss] Can't add a row into a table with ovsdb-client

2017-11-14 Thread Ben Pfaff
On Tue, Nov 14, 2017 at 02:40:22PM -0500, Scott Reeve wrote:
> Tried a whole bunch of things but none seem to work.
> There is one db: "hardware_vtep"
> One of the tables is Ucast_Macs_Local:
> 
> 
> "Ucast_Macs_Local": {
>   "columns": {
> "MAC": {
>   "type": "string"},
> "ipaddr": {
>   "type": "string"},
> "locator": {
>   "type": {
> "key": {
>   "refTable": "Physical_Locator",
>   "type": "uuid"}}},
> "logical_switch": {
>   "type": {
> "key": {
>   "refTable": "Logical_Switch",
>   "type": "uuid",
>   "isRoot": true},
> 
> I want to add one row into this table.
> Does "key" being present mean that the key is required?  Are there two keys
> for Ucast_Macs_Local?
> 
> Here's an example of what I've tried:
> sudo ovsdb-client transact tcp:10.100.52.92:6640 '["hardware_vtep",
> {"op":"insert", "table":"Ucast_Macs_Local",
> "row":{"Logical_Switch":"889240b8-13df-42cb-a733-18efe90aaf72"}}]'
> 
> The syntax of the schema has me quite confused.
> 
> Any suggestions are greatly appreciated.

Did you read RFC 7047?  It explains the schema syntax and the
transaction syntax.
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


[ovs-discuss] Can't add a row into a table with ovsdb-client

2017-11-14 Thread Scott Reeve
Tried a whole bunch of things but none seem to work.
There is one db: "hardware_vtep"
One of the tables is Ucast_Macs_Local:


"Ucast_Macs_Local": {
  "columns": {
"MAC": {
  "type": "string"},
"ipaddr": {
  "type": "string"},
"locator": {
  "type": {
"key": {
  "refTable": "Physical_Locator",
  "type": "uuid"}}},
"logical_switch": {
  "type": {
"key": {
  "refTable": "Logical_Switch",
  "type": "uuid",
  "isRoot": true},

I want to add one row into this table.
Does "key" being present mean that the key is required?  Are there two keys
for Ucast_Macs_Local?

Here's an example of what I've tried:
sudo ovsdb-client transact tcp:10.100.52.92:6640 '["hardware_vtep",
{"op":"insert", "table":"Ucast_Macs_Local",
"row":{"Logical_Switch":"889240b8-13df-42cb-a733-18efe90aaf72"}}]'

The syntax of the schema has me quite confused.

Any suggestions are greatly appreciated.
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss