cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1079
Views
5
Helpful
2
Replies

NSO with FMC: restconf - challenge with object creation

Michal Garcarz
Cisco Employee
Cisco Employee

Hello Team,

 

NSO 4.6.2 with FMC registred, i am using restconf API to manage my FMC via NSO. I am able to read the objects, example in CLI:

 

 #show devices device FMC01 | display xpath
.....
/devices/device[name='FMC01']/cisco-fmc-meta:ciscofmc-id-store/object/networks[name='mgarcarz_object_network_1']/id 005056A5-7145-0ed3-0000-614180324637

 

And i am able to use restconf like this:

GET request for:http://{{host}}:8080/restconf/data/devices/device=FMC01/config/object/networks=mgarcarz_object_network_1

and getting 200 with body:

 

<networks xmlns="http://tail-f.com/ned/cisco-fmc"  xmlns:cisco-fmc="http://tail-f.com/ned/cisco-fmc"  xmlns:ncs="http://tail-f.com/ns/ncs">
    <name>mgarcarz_object_network_1</name>
    <value>1.2.3.0/24</value>
</networks>

 

Now i do struggle with POST and network object creation. When i am passing similar XML for POST i got the following error:

Screen Shot 2018-10-10 at 08.07.05.png

I have tried several combinations, but no luck. What should be the URI and body to create exactly same object which i have displayed above ?

 

Thanks,

Michal

P.S When i use json instead of xml for all operations i do have identical error.

1 Accepted Solution

Accepted Solutions

alam.bilal
Cisco Employee
Cisco Employee

Perhaps try the following as your URL:

POST --> http://{{host}}:8080/restconf/data/devices/device=FMC01/config/object

 

And your body/payload:

<networks>
    <name>mgarcarz_object_network_1</name>
    <value>1.2.3.0/24</value>
</networks>

 See if that works.

View solution in original post

2 Replies 2

alam.bilal
Cisco Employee
Cisco Employee

Perhaps try the following as your URL:

POST --> http://{{host}}:8080/restconf/data/devices/device=FMC01/config/object

 

And your body/payload:

<networks>
    <name>mgarcarz_object_network_1</name>
    <value>1.2.3.0/24</value>
</networks>

 See if that works.

Also, this should be covered in nso_northbound guide with examples.