Re: Using RESTCONF to list bridge


Michal Cmarada <mcmarada@...>
 

Hi,

In previous case if you created a bridge-domain outside of HC
And afterwards you tried to create BD using Honeycomb it failed because BD with the same id as HC was trying to add already existed in vpp. This happens because HC is allocating ids from 1 and there already was a bridge domain with id 1. This happens because model uses names to identify bridge-domains but VPP uses ids. Therefore honeycomb translates this internally to ids. For most configurations HC can recreate this index to name mapping by generating artificial names for Bridge-domains. However this is only triggered on startup. If you add something while HC is running it can most probably break the setup.

Usually it is best if you will have clean VPP before starting honeycomb and afterwards use only honeycomb to configure it. Some configuration can be read from vpp back to HC but there are still cases which will break the setup. Also honeycomb should be the only agent that is configuring VPP. If there are other agents or configuration using cli it can break the setup.

One more note regarding reading of configuration.
To actually read the operational state from the vpp you need to access the operational data store:
http://localhost:8183/restconf/operational/v3po:bridge-domains-state/

To read the configuration (HC configuration for VPP) you need to use configuration data store:
http://localhost:8183/restconf/config/v3po:bridge-domains

For some models you can see the difference also in the container name which will contain the "-state" suffix (bridge-domains-state), but this is not applicable globally for all models.


Michal

-----Original Message-----
From: hc2vpp@... <hc2vpp@...> On Behalf Of Raj
Sent: Wednesday, January 9, 2019 2:17 PM
To: hc2vpp@...
Subject: Re: [hc2vpp] Using RESTCONF to list bridge

A PUT request to
https://192.168.3.145:8445/restconf/config/v3po:bridge-domains/bridge-domain/bridge-domain-3

with following body created a bridge:

{ "bridge-domain": [ { "name": "bridge-domain-3", "flood": "true",
"forward": "false", "learn": "false", "unknown-unicast-flood":
"false", "arp-termination": "false" } ] }

vpp# show bridge
BD-ID Index BSN Age(min) Learning U-Forwrd UU-Flood Flooding ARP-Term BVI-Intf
1 1 0 off on on flood on off N/A
2 2 0 off on on flood on off N/A
3 3 0 off off off drop on off N/A

Thanks and Regards,

Raj

On Wed, Jan 9, 2019 at 5:25 PM Raj via Lists.Fd.Io <rajlistuser=gmail.com@...> wrote:

Hello all,

I am working through the postman examples to get a feel of VPP
RESTCONF API. I have two bridge setup in VPP, which I can see in debug
cli.

vpp# show br
BD-ID Index BSN Age(min) Learning U-Forwrd UU-Flood Flooding ARP-Term
BVI-Intf
1 1 0 off on on flood on off N/A
2 2 0 off on on flood on off N/A

But I am unable to figure out how to get the same listing using API.

https://192.168.3.145:8445/restconf/config/v3po:bridge-domains/bridge-
domains/

gives me

errors: [RestconfError [error-type: protocol, error-tag:
unknown-element, error-message: "bridge-domains" in URI was not found
in parent data node]]

Trying to create a new bridge using PUT to:

https://192.168.3.145:8445/restconf/config/v3po:bridge-domains/bridge-
domain/testBD3
{
"bridge-domain": [
{
"name": "testBD3",
"flood": "true",
"forward": "false",
"learn": "false",
"unknown-unicast-flood": "false",
"arp-termination": "false"
}
]
}

gives:

errors: [RestconfError [error-type: application, error-tag:
operation-failed, error-message: Failed to validate
DataTreeModification, error-info:
io.fd.honeycomb.translate.write.registry.UpdateFailedException:
io.fd.honeycomb.translate.write.WriteFailedException:
io.fd.vpp.jvpp.VppCallbackException:
vppApi.bridge_domain_add_del_reply failed: Bridge domain already
exists (error code: -119)

I guess I am missing some thing here.

Thanks and Regards,

Raj
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#477): https://lists.fd.io/g/hc2vpp/message/477
Mute This Topic: https://lists.fd.io/mt/28983297/157026
Group Owner: hc2vpp+owner@...
Unsubscribe: https://lists.fd.io/g/hc2vpp/unsub
[rajlistuser@...]
-=-=-=-=-=-=-=-=-=-=-=-

Join {hc2vpp@lists.fd.io to automatically receive all group messages.