Skip to Content
Network Automation at Scale
book

Network Automation at Scale

by Mircea Ulinic, Seth House
December 2017
Intermediate to advanced
92 pages
1h 35m
English
O'Reilly Media, Inc.
Content preview from Network Automation at Scale

Chapter 6. The Salt Event Bus

Salt is a heavily asynchronous tool that comes with all the simplicity, reliability, and difficulty inherent in asynchronicity. Minions can request data and files from the master, send job returns or other data, refresh authentication, and more and all of this can happen at any time. Sometimes this is in response to user actions on either the minion or master; other times it is a scheduled job or routine maintenance.

Salt makes use of an event bus internally to send messages from minion to master and from one process to another. As with most things in Salt, this event bus is also exposed to users to extend, read from, and write to.

Event Tags and Data

A Salt event consists of two things: an event tag and event data. Event tags are a slash-delimited string where each slash provides a level of namespacing. Event data is a dictionary that contains a timestamp plus any arbitrary data useful for that type of event.

For example, when a minion finishes processing a job and sends the job return data back to the master, an event is fired that looks similar to the one shown in Example 6-1.

Example 6-1. salt/job/20170706170156951774/ret/device1
{
  "_stamp": "2017-07-06T23:01:57.098368",
  "...snip...": null
}

All Salt events start with salt/, all Salt events start with salt/job/, and so on, with each slash delimiting a new level of namespacing. The event bus in Salt can get quite busy so event tags are often matched-on to filter unwanted event types. (Event tags ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Network Automation Roadmap

Network Automation Roadmap

Steve Petryschuk
Network Automation with Go

Network Automation with Go

Nicolas Leiva, Michael Kashin
Network Automation with Nautobot

Network Automation with Nautobot

Jason Edelman, Bryan Culver, Ken Celenza, Glenn Matthews, Josh VanDeraa, John Anderson, Gary Snider, Christian Adell, Brad Haas

Publisher Resources

ISBN: 9781491992524