api call for establishing a bgp-ls peer


Nikos Skalis <nskalis.amsterdam@...>
 

Hi,

I am trying to bring up a BGP session (linkstate family, if it matters).

When I am making a request using
as URL `/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols`
and as body 

        <name>nl-ams02c-ispbgp01</name>
        <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
        <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
            <global>
                <config>
                    <router-id>10.20.14.1</router-id>
                    <as>xxx</as>
                </config>
                <afi-safis>
                    <afi-safi>
                        <afi-safi-name>LINKSTATE</afi-safi-name>
                    </afi-safi>
                </afi-safis>
            </global>
        </bgp>
    </protocol>

It seems that the family was added to the BGP speaker, I am checking this with

    In [5]: url = "/restconf/operational/bgp-rib:bgp-rib"
    
    In [6]: requests.get('http://{}:{}{}'.format(odl['api']['ipaddr'],odl['api']['port'],url), auth=auth).json()
    Out[6]: 
    {'bgp-rib': {'rib': [{'id': 'nl-ams02c-ispbgp01',
        'loc-rib': {'tables': [{'afi': 'bgp-linkstate:linkstate-address-family',
           'safi': 'bgp-linkstate:linkstate-subsequent-address-family',
           'bgp-linkstate:linkstate-routes': {},
           'attributes': {'uptodate': True}}, ...

**Question #1**
I do not know though how to check and where should I expect to see the local IP address (10.20.14.1 in the above example) that is used for this BGP session. What would be the HTTP GET request for that ?

Next, when I am trying to configure the BGP peer using
as URL `/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/nl-ams02c-ispbgp01/bgp/neighbors`
and as body 

    <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
        <neighbor-address>10.20.14.0</neighbor-address>
        <afi-safis>
            <afi-safi>
                <afi-safi-name>LINKSTATE</afi-safi-name>
            </afi-safi>
        </afi-safis>
    </neighbor>

I get the following error:

    {'errors': {'error': [{'error-type': 'protocol',
        'error-tag': 'malformed-message',
        'error-message': 'Error parsing input: Child "protocol" was not found in parent schema node "(urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions?revision=2017-12-07)neighbors"',
        'error-info': 'Child "protocol" was not found in parent schema node "(urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions?revision=2017-12-07)neighbors"'}]}}

**Question #2** 
Could you please help me and advise on the correct HTTP call to configure a BGP peer ? The URL seems not to be the correct one according to the documentation

PS. I am running OpenDaylight Oxygen-SR2