API Support


hi, Is there any API support for features provided by Cumulus Linux or its all CLI interface only?If API support is there can some one point me to the documentation?

13 replies

Userlevel 5
At present time it is standard command line Linux. There is no API support.
ok thanks Scott. Any plans to expose the functionalities via APIs in near future?
Userlevel 4
Hey Amruta Misra,

What do you need to do? Can you provide me with a use-case? Linux has plenty of APIs so it would help to figure out what you are trying to solve.
I believe what Amruta ask for is "a reasonably sound management plane implementation", please don't get confused, "standard command line linux" doesn't provide that 🙂

http://blog.ipspace.net/2014/02/cli-or-api-wait-do-you-really-have-to.html
Userlevel 4
@Eric

From the article you quoted

How many vendors can give you the same control-plane state or data-plane counters that you can inspect with CLI commands in an XML- or JSON-formatted response?

We provide this with Cumulus Linux, most of the commands (if not all) will have JSON
e.g.
leaf01# sh ip bgp sum        json  JavaScript Object Notation
Reading the article further->

but if you did it right from the very beginning, every single CLI command should be accessible as an API call and vice versa.

Thats what Cumulus Linux provided. Using the standard Linux kernel and improving it so every command has JSON output. No special tool or proprietary method is needed to get information out of a Cumulus switch. What we see with customers most often is using off-the-shelf tools like Ansible, Puppet and Chef and even using tools like Serverspec and Behave to check configurations.

Oh, and before anyone mentions increased testing requirements – if you don’t have an automated testing mechanism that would test CLI and API access to every object exposed by your software, you have a much bigger problem on your hands.

Not only can you do this with Cumulus Linux, you can download free Cumulus VX and simulate and test completely in software. No strings attached. You will see loads of customers here in the community asking when the next Cumulus VX will come out so they begin testing before touching their production network.

This is why I am asking for more detail, b/c to a lot of customers we already provide an API, and easy parsable JSON output so the idea of an API is a little bit ambiguous and needs more detail. I know the above might not be enough, so I just need more clarification.
have to admit cisco cli or arista capi is easy than Ansible playbook,

have you ever tried look at "show lldp neighbors" from all vendor 🙂
please hock up a fully connected chassis and have few mis-connected links, and do it in the lab with lot of noise around.

Userlevel 4

have you ever tried look at "show lldp neighbors" from all vendor :

Yes, used to work for Cisco for years. I worked specifically in an I/O lab testing Juniper and Cisco issue for US Govt certifications. Not sure what you are getting at. We also support lldp on Cumulus Linux.

cumulus@leaf01$ netshow lldp -------------------------------------------------------------------- To view the legend,  rerun "netshow" cmd with the  "--legend" option -------------------------------------------------------------------- Local Port    Speed    Mode                  Remote Port    Remote  Host     Summary ------------  -------  --------------  ----  -------------  ---------------  ------------------------- eth0          10G      Mgmt            ====  swp6           oob-mgmt-switch  IP: 192.168.0.11/24(DHCP) swp49         10G      BondMember      ====  swp49          leaf02           Master: peerlink(UP) swp50         10G      BondMember      ====  swp50          leaf02           Master: peerlink(UP) swp51         10G      Unnumbered      ====  swp1           spine01 swp52         10G      Unnumbered      ====  swp1           spine02
@eric,

Also for checking your cabling in an automated way:

https://docs.cumulusnetworks.com/display/DOCS/Prescriptive+Topology+Manager+-+PTM

Userlevel 3
@Eric,

Ask yourself this: What is the API to a Linux server?

Is there one? Is it "anything you want"?

The problem you are facing it the problem most people entrenched in the proprietary world of networking are facing: You only have the limited access to a platform that the vendor has deemed you should have. That's usually called an API. The only way you can interact with the platform is through this limited set of functions allowed by the API.

But with Cumulus Linux, it's just Linux. It's totally open. You can do whatever you want. There's no need for us to define a restrictive API because that would only be limiting your options. Just like on a Linux server, you are free to interact with the switch in any way you want. There's SSH, bash, json, SNMP, Netlink, and on and on. Don't like any of those? Then search the Debian package library and "apt-get install" something someone else has developed. Or develop your own. Python, Perl, gcc; pick your favorite and make your switch do whatever you want it to do.

Free your mind. And welcome to the brave new world of open networking.

Scott
appreciate your reply, and thanks for all the great info!

however as linux distribution, cumulus linux should do something extra to make this distribution *just work( as a network device), ask user to 'apt-get install' and hope a pkg developed by someone else will just work is not realistic. I would rather to make switch "be a switch" first.

Thanks everyone for having such a good discussion.
Sean, To answer your question on what is my requirement, If I want to use cumulus Linux for SDN, I probably will need APIs?
How do I call from a different agent either co-located or remote ? Do I script the CLI commands?
Userlevel 4

however as linux distribution, cumulus linux should do something extra to make this distribution *just work( as a network device), ask user to 'apt-get install' and hope a pkg developed by someone else will just work is not realistic. I would rather to make switch "be a switch" first.

Hey Eric,

Sorry you have a bad impression here. Cumulus Linux ships with mstpctl, Quagga, netshow, ifupdown2, clagd (an Open Source implementation of MLAG) and more. It sounds like either
  • You are not a fan of Cumulus Linux or Linux on a switch Or
  • There is some mis-information or something else going on because we do ship with lots of tools and 24x7x365 support with our product.
The former I can't help with. But the latter I would like to offer you a highly discounted boot camp pass. If you email me at sean at cumulusnetworks.com I can make sure you get a coupon for one of our Open Networking Boot Camp taught by a Consultant from Cumulus Networks. Like yourself all of our consultants came from traditional vendors and can help bridge the gap from closed proprietary networking to Open Networking on Cumulus Linux.
Userlevel 4

Sean, To answer your question on what is my requirement, If I want to use cumulus Linux for SDN, I probably will need APIs?

How do I call from a different agent either co-located or remote ? Do I script the CLI commands?

Hey Amruta,

Can you elaborate further on SDN? Software Defined Networking is a very broad and unspecific terminology.

  • We support Network Virtualization (e.g. VMware NSX, Midokura's Midonet, Plumgrid, etc.)
  • We support NetDevOps Tools like Ansible, Puppet and Chef.
  • We support Native Linux Applications (e.g. you can literally install a webapp on the switch)
The list goes on and on. I would suggest if you are exploring SDN to attend a boot camp as well (see my suggestion to Eric above) and you can gather a lot of knowledge to know what questions to ask.

Reply