Now that's great and all, but what can Orchestrator help us do with it? Well with the addition of a couple of activities - "Convert XML to JSON" and "Convert JSON to XML" it all becomes quite easy! In my development with Orchestrator I have found using XPATH queries and trying to stay in the XML format is best for ease of use and for the product in general. XPATH query is a wonderful tool for pulling data out of XML based messages and is highly useful(and near a requirement) for developing strong automations with web service calls. The great Orchestrator development team has almost made it trivial for you to be able to work with both XML and JSON based web services. The eaiest case is to receive JSON back from a web call and then pass it into a "Convert JSON to XML" activity. The output XML will be a nicely and neatly formated piece of XML that you can easily do an xpath query from. For example
<para>A meta-markup language, used to create markup languages such as DocBook.</para>
(Sorry about the formatting)
Now doing XPATH queries on this xml is almost as trivial. If I want to pull out the Abbreviation, just XPATH Query it using "//Abbrev". (as an example). Before these activities you would have had to do string and regular expression work throughout a JSON response and that would have not been too pretty!
While this session is a short and sweet one, I could not go on without a video! So I have a quick (less than 10 minute) video on me using the JSON and XML conversion activities and running XPATH against it. (using the same demo JSON as above)
I hope after watching this you will feel confident in using JSON based web services in your automations. Please feel free to post any comments/questions/etc in the blog or send me an email.
No questions this week! Hopefully we'll get some in to answer for next week!
Ever week I will pick a handful of questions from you, the reading CPO public, to answer in this part of the blog. Please post comments/questions below. I will no longer be using the external e-mail from previous blogs.
Please also let me know if you like the format of this blog and what else you would like to see/know about. Feel free to give any ideas as to future blog posts, etc and I will be happy to post them. I hope to do more how-tos, best practices, tips, tricks, and hopefully some interviews of the important people behind the scenes of CPO.
WEEKLY AUTOMATION BLOG DISCLAIMER: As always, this is a blog and my (Shaun Roberts) thoughts on CPO, my thoughts on best practices, and my experiences with the product and customers. The above views are in no way representative of Cisco or any of it's partners, etc. None of these views, etc are supported and this is not a place to find standard product support. If you need standard product support please do so via the current call in numbers on Cisco.com or email firstname.lastname@example.org
Hi,I want to upgrade nxos.22.214.171.124 to nxos.9.3.7.The upgrade path nxos.126.96.36.199 ,7.0.3.I7.9 and finally nxos.9.3.7 So my question do I need to copy the os to both SUP before upgrading ? Second question if i...
All,I m having trouble nating ipv6 to ipv4 on 2 core NX 7707 running 8.5.2.keep getting an error" ipv6 translation failed. source is not vailed" Have anybody encounter this issue before? It's not a bug as I searched. Thxmohamed
Hello, Some EPGs that are configured stactically for trunking in a correspondent vlan are not showing as allowed on the interface, even if the layer2 communication works. I'm new to the aci world but is this a desirable state ? Here the con...
Hi!we had one dvs which is associated epgs. We have deleted it then create a new one. But now we couldn't remove old dvs under epgs. When we try to remove this fault appears:Failed to delete object.Request in progress, please check state using URL: /api/c...
Hi,Hi, If a scenario like above where sw1 and sw2 is connected using trunk with swA and sw Band add a trunk between A and B , 192.168.8.100 can reach 192.168.101 ? The above design is valid ? If yes , when vpc peer link do...