10-19-2018 12:54 AM - edited 03-01-2019 04:13 AM
Using REST API you get the operations container. Is there a flag for omitting the operations container in the response (both the built in and user defined in the yang service)?
I use pyangbind to create an service Object in my application. I don't want to include the operations part in my object.
I handle it now but its a bit messy...
Example(postman):
URL: GET https://10.12.10.75:8888/api/config/lan5-l1:lan5/lan5-l3-uc:lan5-l3-uc-service/bitcom,bb
HEADER: accept/application/vnd.yang.data+json
Response:
{
"lan5-l3-uc:lan5-l3-uc-service": {
"sp-name": "bitcom",
"service-type": "bb",
"spid": 15,
"nni": [
{
"device-name": "gbg0-spser-1"
},
{
"device-name": "gsl-spser-1"
}
],
"subscriber-termination": [
{
"primary-bng": "kt-bng-01"
},
{
"primary-bng": "lib-bng-01"
},
{
"primary-bng": "mtc-bng-01"
},
{
"primary-bng": "sv-bng-01"
}
],
"operations": {
"check-sync": "/api/config/lan5/lan5-l3-uc:lan5-l3-uc-service/bitcom,bb/_operations/check-sync",
"deep-check-sync": "/api/config/lan5/lan5-l3-uc:lan5-l3-uc-service/bitcom,bb/_operations/deep-check-sync",
"re-deploy": "/api/config/lan5/lan5-l3-uc:lan5-l3-uc-service/bitcom,bb/_operations/re-deploy",
"reactive-re-deploy": "/api/config/lan5/lan5-l3-uc:lan5-l3-uc-service/bitcom,bb/_operations/reactive-re-deploy",
"touch": "/api/config/lan5/lan5-l3-uc:lan5-l3-uc-service/bitcom,bb/_operations/touch",
"get-modifications": "/api/config/lan5/lan5-l3-uc:lan5-l3-uc-service/bitcom,bb/_operations/get-modifications",
"un-deploy": "/api/config/lan5/lan5-l3-uc:lan5-l3-uc-service/bitcom,bb/_operations/un-deploy"
}
}
}
Solved! Go to Solution.
10-25-2018 08:54 AM - edited 10-25-2018 08:57 AM
Append the following to the end of your URL should exclude operations
?operations=false
I tried it using https://wwwin-github.cisco.com/nsopl/rest-api-explorer like this:
/api/config/devices/device/DEVICE1?operations=false
10-26-2018 12:33 AM
Thanks!
As an addition if there are user created operations nested in the request the following works as well:
<path>?deep&operations=false
10-25-2018 08:54 AM - edited 10-25-2018 08:57 AM
Append the following to the end of your URL should exclude operations
?operations=false
I tried it using https://wwwin-github.cisco.com/nsopl/rest-api-explorer like this:
/api/config/devices/device/DEVICE1?operations=false
10-26-2018 12:33 AM
Thanks!
As an addition if there are user created operations nested in the request the following works as well:
<path>?deep&operations=false
10-26-2018 07:32 AM
Yes, <path>?deep&operations=false will work.
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