Foreword |
|
xiii | |
Preface |
|
xv | |
1 Introduction |
|
1 | (26) |
|
|
1 | (5) |
|
|
2 | (1) |
|
Automation Prevents Human Error |
|
|
3 | (1) |
|
|
4 | (1) |
|
Automation Prevents Copy/Paste Errors |
|
|
4 | (1) |
|
Automation Enables New Services |
|
|
5 | (1) |
|
Management System Internals |
|
|
6 | (5) |
|
Accessing the Management System |
|
|
6 | (1) |
|
|
7 | (2) |
|
|
9 | (2) |
|
Configuration Databases and the Commit Model |
|
|
11 | (14) |
|
|
11 | (10) |
|
|
21 | (4) |
|
Information About the Book |
|
|
25 | (2) |
2 RPC Mechanisms |
|
27 | (66) |
|
|
27 | (27) |
|
|
31 | (11) |
|
Using Structured Data in Python |
|
|
42 | (12) |
|
Running RPCs on a Juncos Device |
|
|
54 | (3) |
|
|
56 | (1) |
|
|
57 | (14) |
|
|
59 | (4) |
|
Discovering Operational RPC Syntax |
|
|
63 | (5) |
|
Discovering RPC Reply Syntax |
|
|
68 | (3) |
|
|
71 | (20) |
|
Configuration Representation in XML |
|
|
72 | (3) |
|
Discovering XML Configuration Syntax |
|
|
75 | (3) |
|
Operational RPCs to View and Change the Configuration |
|
|
78 | (1) |
|
Viewing the Configuration |
|
|
79 | (2) |
|
Changing the Configuration |
|
|
81 | (10) |
|
|
91 | (2) |
3 The RESTful API Service |
|
93 | (70) |
|
Enabling the RESTful API Service |
|
|
94 | (1) |
|
|
95 | (4) |
|
Authentication and Authorization |
|
|
99 | (4) |
|
Formatting HTTP Responses |
|
|
103 | (7) |
|
|
110 | (2) |
|
Adding Parameters to RPCs |
|
|
112 | (5) |
|
Multiple RPCs in One Request |
|
|
117 | (4) |
|
|
121 | (5) |
|
|
126 | (5) |
|
Using the RESTful APIs in Python |
|
|
131 | (26) |
|
|
134 | (2) |
|
|
136 | (3) |
|
Gather LLDP Neighbor Information |
|
|
139 | (4) |
|
Gather and Parse Interface Descriptions |
|
|
143 | (4) |
|
Check for XML Warnings and Errors |
|
|
147 | (1) |
|
Compare Current and Previous LLDP Neighbor Information |
|
|
148 | (3) |
|
Build a Candidate Configuration |
|
|
151 | (1) |
|
Apply and Commit the Candidate Configuration |
|
|
152 | (3) |
|
Parse Multi-RPC Responses |
|
|
155 | (2) |
|
|
157 | (1) |
|
Additional RESTful API Service Configuration |
|
|
157 | (2) |
|
|
159 | (1) |
|
|
160 | (1) |
|
|
161 | (2) |
4 Junos PyEZ |
|
163 | (86) |
|
|
164 | (1) |
|
|
165 | (10) |
|
Creating a Device Instance |
|
|
166 | (3) |
|
|
169 | (1) |
|
Authentication and Authorization |
|
|
170 | (1) |
|
|
171 | (2) |
|
|
173 | (1) |
|
|
174 | (1) |
|
|
175 | (8) |
|
|
175 | (3) |
|
|
178 | (1) |
|
|
178 | (2) |
|
|
180 | (3) |
|
|
183 | (11) |
|
|
183 | (7) |
|
|
190 | (2) |
|
|
192 | (1) |
|
|
193 | (1) |
|
Operational Tables and Views |
|
|
194 | (24) |
|
Prepackaged Operational Tables and Views |
|
|
194 | (6) |
|
Creating New Operational Tables and Views |
|
|
200 | (12) |
|
Using the New Operational Table and View |
|
|
212 | (3) |
|
Applying a Different View |
|
|
215 | (2) |
|
Saving and Loading XML Files from Tables |
|
|
217 | (1) |
|
|
218 | (12) |
|
Loading Configuration Changes |
|
|
218 | (2) |
|
|
220 | (6) |
|
Viewing Configuration Differences |
|
|
226 | (1) |
|
Committing Configuration Changes |
|
|
227 | (2) |
|
Using the Rescue Configuration |
|
|
229 | (1) |
|
|
230 | (1) |
|
|
231 | (16) |
|
|
233 | (2) |
|
|
235 | (4) |
|
Gather LLDP Neighbor Information |
|
|
239 | (1) |
|
Gather and Parse Interface Descriptions |
|
|
240 | (2) |
|
Compare Current and Previous LLDP Neighbor Information |
|
|
242 | (1) |
|
Build, Apply, and Commit the Candidate Configuration |
|
|
243 | (4) |
|
|
247 | (1) |
|
|
247 | (1) |
|
NETCONF Libraries for Other Languages |
|
|
247 | (1) |
|
|
248 | (1) |
5 Commit Scripts |
|
249 | (80) |
|
|
249 | (4) |
|
Custom Configuration Checks |
|
|
249 | (1) |
|
Automatically Fixing Mistakes |
|
|
250 | (1) |
|
Dynamically Expanding Configuration |
|
|
250 | (3) |
|
|
253 | (5) |
|
|
254 | (1) |
|
Commit Script XML Input and Output Documents |
|
|
255 | (2) |
|
Performing Other Operations |
|
|
257 | (1) |
|
Changing the Configuration |
|
|
258 | (3) |
|
Handling Transient Changes |
|
|
258 | (2) |
|
Handling Permanent Changes |
|
|
260 | (1) |
|
Writing Commit Scripts in SLAX/XSLT |
|
|
261 | (27) |
|
Overview of a SLAX Script |
|
|
262 | (2) |
|
Building an Output Document |
|
|
264 | (6) |
|
Working with Variables and XML Data |
|
|
270 | (5) |
|
|
275 | (7) |
|
|
282 | (4) |
|
|
286 | (2) |
|
|
288 | (39) |
|
Example: Custom Configuration Checks |
|
|
288 | (14) |
|
Example: Automatically Fixing Mistakes |
|
|
302 | (7) |
|
Example: Dynamically Expanding Configuration |
|
|
309 | (18) |
|
|
327 | (2) |
6 Op Scripts |
|
329 | (68) |
|
|
329 | (2) |
|
|
329 | (1) |
|
Automatically Responding to Events |
|
|
330 | (1) |
|
|
330 | (1) |
|
Overview of Op Script Operation |
|
|
331 | (7) |
|
|
333 | (1) |
|
|
334 | (1) |
|
Op Script Document Processing |
|
|
335 | (2) |
|
Op Script Output Document |
|
|
337 | (1) |
|
Operational and Configuration State |
|
|
338 | (12) |
|
Interacting with Operational State |
|
|
338 | (6) |
|
Interacting with Configuration State |
|
|
344 | (6) |
|
Op Script Input and Output |
|
|
350 | (5) |
|
|
351 | (1) |
|
Displaying Immediate Output |
|
|
351 | (1) |
|
|
352 | (3) |
|
Some Useful Tools for Op and Event Scripts |
|
|
355 | (2) |
|
|
355 | (1) |
|
|
356 | (1) |
|
Generating SNMP Objects and Traps |
|
|
356 | (1) |
|
Debugging Op and Event Scripts |
|
|
357 | (10) |
|
Printing Progress Messages |
|
|
357 | (1) |
|
|
358 | (4) |
|
|
362 | (1) |
|
|
362 | (5) |
|
|
367 | (2) |
|
|
369 | (26) |
|
Example: Custom CLI Command |
|
|
369 | (11) |
|
Example: Filtering CLI Output |
|
|
380 | (15) |
|
|
395 | (2) |
7 Event Scripts and Event Policies |
|
397 | (44) |
|
Overview of Event Script Operation |
|
|
397 | (6) |
|
Event Script Input Document |
|
|
399 | (3) |
|
|
402 | (1) |
|
Event Script Document Processing |
|
|
402 | (1) |
|
Event Script Output Document |
|
|
403 | (1) |
|
|
403 | (26) |
|
|
403 | (2) |
|
Defining Event Policy Match Criteria |
|
|
405 | (7) |
|
Defining Event Policy Actions |
|
|
412 | (9) |
|
|
421 | (2) |
|
Embedding Event Policies in Event Scripts |
|
|
423 | (5) |
|
|
428 | (1) |
|
Configuring Event Scripts |
|
|
429 | (1) |
|
Example: Responding to a Flapping Link |
|
|
430 | (10) |
|
|
431 | (1) |
|
|
432 | (1) |
|
|
433 | (5) |
|
|
438 | (2) |
|
|
440 | (1) |
8 Initial Provisioning |
|
441 | (16) |
|
|
442 | (10) |
|
|
452 | (3) |
|
|
455 | (2) |
9 Puppet |
|
457 | (52) |
|
|
458 | (2) |
|
Components for Junos Devices |
|
|
460 | (1) |
|
Installation and Configuration |
|
|
461 | (10) |
|
|
461 | (2) |
|
|
463 | (5) |
|
Creating a Minimal Manifest |
|
|
468 | (1) |
|
Executing the Puppet Agent for the First Time |
|
|
469 | (2) |
|
|
471 | (6) |
|
|
471 | (2) |
|
|
473 | (1) |
|
|
474 | (1) |
|
|
474 | (1) |
|
|
474 | (2) |
|
|
476 | (1) |
|
|
476 | (1) |
|
Using Core Resource Types |
|
|
477 | (11) |
|
Managing -/.cshrc with the file Resource |
|
|
477 | (4) |
|
Managing puppet.conf with an ERB Template |
|
|
481 | (3) |
|
Managing the Puppet Agent with the cron Resource |
|
|
484 | (4) |
|
Using the netdev Resource Types |
|
|
488 | (20) |
|
The netdev_device Resource |
|
|
488 | (1) |
|
|
489 | (4) |
|
The netdev_interface Resource |
|
|
493 | (3) |
|
The netdev_l2_interface Resource |
|
|
496 | (4) |
|
|
500 | (3) |
|
The netdev_stdlib_junos::applygroup Resource |
|
|
503 | (5) |
|
|
508 | (1) |
10 Ansible |
|
509 | (96) |
|
Architecture and Communication |
|
|
509 | (5) |
|
|
510 | (3) |
|
Communicating with Junos Managed Nodes |
|
|
513 | (1) |
|
Installation and Configuration |
|
|
514 | (6) |
|
|
514 | (2) |
|
Installing the Juniper.junos Role |
|
|
516 | (1) |
|
The Ansible Configuration File |
|
|
516 | (2) |
|
Junos Authentication and Authorization |
|
|
518 | (2) |
|
Creating Ansible Playbooks |
|
|
520 | (36) |
|
|
520 | (3) |
|
|
523 | (5) |
|
|
528 | (1) |
|
|
529 | (2) |
|
|
531 | (6) |
|
|
537 | (11) |
|
|
548 | (4) |
|
|
552 | (1) |
|
|
553 | (2) |
|
|
555 | (1) |
|
Ansible for Junos Modules |
|
|
556 | (11) |
|
|
557 | (1) |
|
|
558 | (1) |
|
|
559 | (1) |
|
|
560 | (1) |
|
|
561 | (1) |
|
|
562 | (1) |
|
|
563 | (2) |
|
|
565 | (1) |
|
|
566 | (1) |
|
|
567 | (36) |
|
Inventory, Variables, and Ansible Configuration Settings |
|
|
567 | (6) |
|
Gathering Junos Facts and Dynamic Groups |
|
|
573 | (10) |
|
|
583 | (4) |
|
|
587 | (10) |
|
|
597 | (6) |
|
|
603 | (2) |
11 Putting Automation into Practice |
|
605 | (28) |
|
|
605 | (10) |
|
|
605 | (6) |
|
|
611 | (4) |
|
|
615 | (16) |
|
|
615 | (11) |
|
Tool-Specific Recommendations |
|
|
626 | (5) |
|
|
631 | (2) |
Glossary |
|
633 | (4) |
Index |
|
637 | |