07-04-2022 07:38 PM
GET http://127.0.0.1:8080/restconf/data/l2vpn-svc:;2vpm-svc/l2vpn-svc=poc01
I can see the operational data "modified" and "directly-modified" is shown in the output.
{ "l2vpn-svc:l2vpn-svc": [ { "vpn-id": "poc01", "modified": { "devices": [ "PE-1", "PE-2", "PE-3" ] }, "directly-modified": { "devices": [ "PE-1", "PE-2", "PE-3" ] },
......
In my understanding, it should be fetched as the operations data, is it correct?
Solved! Go to Solution.
07-04-2022 09:09 PM - edited 07-04-2022 09:16 PM
You perfomed a GET Request without specifying the content so by the default it will use all. Here the explanation from RFC 8040.
If this query parameter is not present, the default value is "all". This query parameter MUST be supported by the server.
So it will return all nodes ( config data / state data ( which is operational data) )
all | Return all descendant data nodes
If you want you want to get only the configuration data nodes you can add ?content=config at the end of the URL ==> without modified, directly-modified,etc..
config | Return only configuration descendant data nodes
By default a node it's considered as config node unless you specify a config false; in the yang. Link to RFC
If you want to get only the instance without the configuration data nodes you can add ?content=nonconfig at the end of the URL. ==> You will get for example modified , directly-modified,log , etc..
nonconfig | Return only non-configuration descendant data nodes
Here example of payload that you will get
nabil@DESKTOP-8ECTID4:~$ curl -u admin:admin http://localhost:8080//restconf/data/l3vpn:vpn/l3vpn=aa -H "Content-Type: application/yang-data+json" { "l3vpn:l3vpn": [ { "name": "aa", "modified": { "devices": ["TEST-IOS-XR-3.01"] }, "directly-modified": { "devices": ["TEST-IOS-XR-3.01"] }, "device-list": ["TEST-IOS-XR-3.01"], "endpoint": [ { "id": "A", "as-number": 64512, "ce": { "device": "TEST-IOS-XR-3.00", "link": { "ip-address": "2.3.4.5" } }, "pe": { "device": "TEST-IOS-XR-3.01", "link": { "interface-name": "GigabitEthernet0/5/6", "ip-address": "1.2.3.4" } } } ] } ] } nabil@DESKTOP-8ECTID4:~$ curl -u admin:admin http://localhost:8080//restconf/data/l3vpn:vpn/l3vpn=aa?content=config -H "Content-Type: application/yang-data+json" { "l3vpn:l3vpn": [ { "name": "aa", "endpoint": [ { "id": "A", "as-number": 64512, "ce": { "device": "TEST-IOS-XR-3.00", "link": { "ip-address": "2.3.4.5" } }, "pe": { "device": "TEST-IOS-XR-3.01", "link": { "interface-name": "GigabitEthernet0/5/6", "ip-address": "1.2.3.4" } } } ] } ] } nabil@DESKTOP-8ECTID4:~$ curl -u admin:admin http://localhost:8080//restconf/data/l3vpn:vpn/l3vpn=aa?content=nonconfig -H "Content-Type: application/yang-data+json" { "l3vpn:l3vpn": [ { "name": "aa", "modified": { "devices": ["TEST-IOS-XR-3.01"] }, "directly-modified": { "devices": ["TEST-IOS-XR-3.01"] }, "device-list": ["TEST-IOS-XR-3.01"], } ] } nabil@DESKTOP-8ECTID4:~$ curl -u admin:admin http://localhost:8080//restconf/data/l3vpn:vpn/l3vpn=aa?content=all -H "Content-Type: application/yang-data+json" { "l3vpn:l3vpn": [ { "name": "aa", "modified": { "devices": ["TEST-IOS-XR-3.01"] }, "directly-modified": { "devices": ["TEST-IOS-XR-3.01"] }, "device-list": ["TEST-IOS-XR-3.01"], "endpoint": [ { "id": "A", "as-number": 64512, "ce": { "device": "TEST-IOS-XR-3.00", "link": { "ip-address": "2.3.4.5" } }, "pe": { "device": "TEST-IOS-XR-3.01", "link": { "interface-name": "GigabitEthernet0/5/6", "ip-address": "1.2.3.4" } } } ] } ] }
07-04-2022 09:09 PM - edited 07-04-2022 09:16 PM
You perfomed a GET Request without specifying the content so by the default it will use all. Here the explanation from RFC 8040.
If this query parameter is not present, the default value is "all". This query parameter MUST be supported by the server.
So it will return all nodes ( config data / state data ( which is operational data) )
all | Return all descendant data nodes
If you want you want to get only the configuration data nodes you can add ?content=config at the end of the URL ==> without modified, directly-modified,etc..
config | Return only configuration descendant data nodes
By default a node it's considered as config node unless you specify a config false; in the yang. Link to RFC
If you want to get only the instance without the configuration data nodes you can add ?content=nonconfig at the end of the URL. ==> You will get for example modified , directly-modified,log , etc..
nonconfig | Return only non-configuration descendant data nodes
Here example of payload that you will get
nabil@DESKTOP-8ECTID4:~$ curl -u admin:admin http://localhost:8080//restconf/data/l3vpn:vpn/l3vpn=aa -H "Content-Type: application/yang-data+json" { "l3vpn:l3vpn": [ { "name": "aa", "modified": { "devices": ["TEST-IOS-XR-3.01"] }, "directly-modified": { "devices": ["TEST-IOS-XR-3.01"] }, "device-list": ["TEST-IOS-XR-3.01"], "endpoint": [ { "id": "A", "as-number": 64512, "ce": { "device": "TEST-IOS-XR-3.00", "link": { "ip-address": "2.3.4.5" } }, "pe": { "device": "TEST-IOS-XR-3.01", "link": { "interface-name": "GigabitEthernet0/5/6", "ip-address": "1.2.3.4" } } } ] } ] } nabil@DESKTOP-8ECTID4:~$ curl -u admin:admin http://localhost:8080//restconf/data/l3vpn:vpn/l3vpn=aa?content=config -H "Content-Type: application/yang-data+json" { "l3vpn:l3vpn": [ { "name": "aa", "endpoint": [ { "id": "A", "as-number": 64512, "ce": { "device": "TEST-IOS-XR-3.00", "link": { "ip-address": "2.3.4.5" } }, "pe": { "device": "TEST-IOS-XR-3.01", "link": { "interface-name": "GigabitEthernet0/5/6", "ip-address": "1.2.3.4" } } } ] } ] } nabil@DESKTOP-8ECTID4:~$ curl -u admin:admin http://localhost:8080//restconf/data/l3vpn:vpn/l3vpn=aa?content=nonconfig -H "Content-Type: application/yang-data+json" { "l3vpn:l3vpn": [ { "name": "aa", "modified": { "devices": ["TEST-IOS-XR-3.01"] }, "directly-modified": { "devices": ["TEST-IOS-XR-3.01"] }, "device-list": ["TEST-IOS-XR-3.01"], } ] } nabil@DESKTOP-8ECTID4:~$ curl -u admin:admin http://localhost:8080//restconf/data/l3vpn:vpn/l3vpn=aa?content=all -H "Content-Type: application/yang-data+json" { "l3vpn:l3vpn": [ { "name": "aa", "modified": { "devices": ["TEST-IOS-XR-3.01"] }, "directly-modified": { "devices": ["TEST-IOS-XR-3.01"] }, "device-list": ["TEST-IOS-XR-3.01"], "endpoint": [ { "id": "A", "as-number": 64512, "ce": { "device": "TEST-IOS-XR-3.00", "link": { "ip-address": "2.3.4.5" } }, "pe": { "device": "TEST-IOS-XR-3.01", "link": { "interface-name": "GigabitEthernet0/5/6", "ip-address": "1.2.3.4" } } } ] } ] }
07-05-2022 01:19 AM
Thank you @Nabsch for the elaborate explanation!It's quite helpful!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide