Howdy out there in Automation land! 2015 has been going for 2.5 months now and I truly apologize for not getting blogs out sooner! I will be publishing this blog and another blog in the next week to catch up. Next blog we will discuss triggers in CPO and all their uses plus some basics around logic in CPO. This time, we cover a more advanced topic around programming and programming structures. We are going to cover queues/stacks and how they can be implemented in CPO and uses to help with the issue of concurrency in programming especially when we make API calls. Let's look at a couple of quick definitions....
This is a generic queue which can do the basics. While this is good, we need to attack an issue we can run into with CPO.
What happens when we want to call the same API a ton of times but that API has a limit on concurrent connections or IT limits us or we need to limit ourselves? We need to implement a process queue. Where we can queue processes up for use/connection to the API(or some other system) and then process those.
I like to think of this idea like a bouncer at a party. Imagine a party room where 10 people are allowed in. (these would be our 10 connections to an API) 1 person comes up and the bouncer sees no one in the room, he lets that person into party. No issue. Let's say the room is now full with 10 people. The 11th person comes up and asks the bouncer to go in. The bouncer says "wait and let me look inside". The bouncer looks inside and sees that that room is full, and tells the 11th person, "no you cannot enter, please wait 5 minutes and ask me again". 5 minutes later the person asks again and the bouncer looks into the room. It looks like 2 people have "left" or stopped using the API and there are 2 open spots, so the bouncer lets the 11th person into the room.
But we can run into an issue.... normally a person will stay in and party for a while and then walk out the exit freeing up that space. What happens if the person passes out while at the party? Their space is full and "stuck". We can run into the same situation if we are queuing up processes and allowing them access to the APIs/Systems and one of the processes fails. It can be "stuck" in queue. So in this case, we have another bouncer who waits at the back door. If he hears that someone is stuck or passed out, he looks in and tries to find that person. If he finds them, he removes them, freeing up a space. We can make use of this by using the "Failed Process State" trigger. So if the process fails, we look at the process queue and if the process is still in queue, we remove it.
This is how I wrote and built my process queuing that I use for my API calls. The below VOD explains this idea and how it works, explains my basic queue class, and helps you to develop a stack class. (just as a programming example). This process queuing was built on top of the original CIAC solution for this and then I expanded on it. This VOD is a bit longer than normal, but hey, I figured you, the readers, were worth the extra time since it has been a while since I blogged.
No questions this month! Hopefully we'll get some in to answer for next time!
Every month 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 community,Has anyone successfully configured PBR in a contract with vzAny acting as both Provider and Consumer (any to any)?Apparently, the release notes of 3.2(1), White Paper and Cisco Live BRKSEC-2048 all briefly mentioned we could, without fur...
I am doing a fresh install of APIC on my lab Standalone Controller due to HDD Replacement.APIC-SERVER-L2BIOS Version: C220M188.8.131.52c getting installation error, I feel it is related to TPM. Anyone who has faced similar challenge?Attaching snapsh...
Hi,Cisco Nexus, Other Data Center SwitchesJust need help to confirm the difference between the 3 Part Numbers for Cisco Nexus 9500 Series Chassis. As per my further research, it shows the only difference between the 3 is in the bundling (Components) as sh...
Hello,I found documentation discrepancy about the ports speed capability of the Nexus 9348GC-FXP.The datasheet from Cisco is : https://www.cisco.com/c/en/us/products/collateral/switches/nexus-9000-series-switches/datasheet-c78-742284.html This d...
Hi, I have some queries regarding VMM Integration to aci. My ACI topology is like 1 BD = 1 EPG = 1 VLAN type. All vlan gateways are on firewall, outside the ACI. Using dot1q , i am flowing traffic from endpoint to firewall Gateway. A...