Download Complete Mastering Python Network Automation Tim Peters PDF for All Chapters
Download Complete Mastering Python Network Automation Tim Peters PDF for All Chapters
com
https://ebookmeta.com/product/mastering-python-network-
automation-tim-peters/
OR CLICK BUTTON
DOWNLOAD NOW
https://ebookmeta.com/product/network-automation-using-python-3-an-
administrators-handbook-1st-edition-jithin-aby-alex/
ebookmeta.com
https://ebookmeta.com/product/introduction-to-ansible-network-
automation-a-practical-primer-brendan-choi/
ebookmeta.com
https://ebookmeta.com/product/studies-in-chinese-literary-genres-
cyril-birch-editor/
ebookmeta.com
3D and Circuit Integration of MEMS 1st Edition Masayoshi
Esashi
https://ebookmeta.com/product/3d-and-circuit-integration-of-mems-1st-
edition-masayoshi-esashi/
ebookmeta.com
https://ebookmeta.com/product/star-wars-myths-fables-george-mann/
ebookmeta.com
https://ebookmeta.com/product/a-course-of-modern-analysis-5th-edition-
e-t-whittaker/
ebookmeta.com
https://ebookmeta.com/product/beastly-bullies-loved-by-three-7-1st-
edition-evie-rae/
ebookmeta.com
Export Control Law and Regulations Handbook A Practical
Guide to Military and Dual Use Goods Trade Restrictions
and Compliance 3rd edition Yann Aubin
https://ebookmeta.com/product/export-control-law-and-regulations-
handbook-a-practical-guide-to-military-and-dual-use-goods-trade-
restrictions-and-compliance-3rd-edition-yann-aubin/
ebookmeta.com
MASTERING PYTHON
NETWORK AUTOMATION
Automating Container Orchestration,
Configuration, and Networking with
Terraform, Calico, HAProxy, and Istio
Tim Peters
Content
Preface
Chapter 1: Python Essentials for Networks
Role of Python in Network Programming
Overview
Factors Benefitting Networking
Learn to use Data Types
Numeric Data Types
Boolean Data Type
Sequence Data Types
Mapping Data Types
Set Data Types
Binary Data Types
Exploring Loops
For Loops
While Loops
Working with Functions
Defining Functions
Calling Functions
Default Arguments
Variable-length Arguments
Lambda Functions
Recursion
Global and Local Variables
Function Arguments
Nested Functions
Summary
Chapter 2: File Handling and Modules in Python
File Handling
Opening and Closing Files
Reading from Files
Writing to Files
Appending to Files
With Statement
Exception Handling:
Utilizing Modules
Creating a Module
Importing a Module
Built-In Modules
Creating Packages
Standard Library Modules
My First Python Script
Summary
Chapter 3: Preparing Network Automation Lab
Components of Network Automation Process
Network Devices
Network Emulator
Python Environment
Automation Scripts
Putting It All Together
Benefits of Network Automation Lab
Install NS3 Network Simulator
System Requirements
Install Required Dependencies
Download NS-3
Install Python
Update System
Install Python
Install pip
Install paramiko, Netmiko and Nornir
Install Virtual Environment
Create Virtual Environment
Activate the Virtual Environment
Install Python Libraries in Virtual Environment
Deactivate the Virtual Environment
Install Visual Studio Code
Download and Install VS Code
Install Python Extension
Configure Python Interpreter
Create Python Project
Write Python Code
Run Python Code
Summary
Chapter 4: Configuring Libraries and Lab Components
Nornir
Architecture of Nornir
Significance of Nornir
Paramiko
Architecture of Paramiko
Significance of Paramiko
Netmiko
Architecture of Netmiko
Significance of Netmiko
PyEZ
Architecture of PyEZ
Significance of PyEZ
Configure nornir, paramiko, netmiko and pyEZ
Installing and Configuring Nornir
Installing and Configuring Paramiko
Installing and Configuring Netmiko
Installing and Configuring PyEZ
Configure Ports
Configuring Ports on Switches
Configuring Ports on Routers
Configure Hosts
Configuring Hosts on Windows
Configuring Hosts on Linux
Configure Servers
Installing Server Operating System
Configuring Network Settings
Installing and Configuring Server Software
Configure Network Encryption
SSL/TLS
IPsec
SSH
VPN
Testing the Network Automation Environment
Test Connectivity between Hosts
Test Port Connectivity
Test SSH Connectivity
Test Network Automation Libraries
Test NS3 Emulator
Test Network Encryption
Summary
Chapter 5: Code, Test & Validate Network Automation
Understanding Network Automation Scripts
Procedure of Network Automation Scripts
Define Variables for Automation Scripts
Install Required Libraries
Import Libraries
Define Variables
Connect to Device
Send Configuration Commands
Close Connection
Create Script to Use Variables
Run the Script
Write Codes using Python Tools
Install Required Libraries and Tools
Import Libraries
Define Inventory
Define Tasks
Define Playbook
Execute the Script
Test and Validate the Script
Testing Network Automation Scripts
Set Up a Test Environment
Create Test Cases
Run the Code
Document Test Results
Debug Errors
Identify the Error or Issue
Review the Code
Use Print Statements
Use a Debugger
Fix the Error or Issue
Validate Network Automation Scripts
Prepare the Production Environment
Deploy Code to Production Environment or Devices
Run the Code on Production Environment or Devices
Verify the Output
Summary
Chapter 6: Automation of Configuration Management
Why Configuration Management?
Need of Configuration Management
Role of Python in Configuration Management
Server Provisioning with Terraform
Set up AWS Credentials
Install Terraform
Define Terraform Configuration
Initialize Terraform
Apply Terraform Configuration
Connect to EC2 Instance
Creating Server
Testing Server
Using Python to Automate System Settings
Import Necessary Modules
Define Timezone
Execute Command to Change Timezone
Verify Setting the Timezone
Using Python to Modify Base Configurations
Using Terraform to Modify Base Configurations
Automating System Identification
Install Terraform Module
Python Script to Retrieve System Information
Using Python to Automate Patches and Updates
Install Necessary Libraries
Check for Available Updates
Upgrade the System
Reboot the System
Schedule Regular Updates
Using Terraform to Roll Patches and Updates
Create Configuration File
Applying Configuration File
Identify Unstable and Non-compliant Configurations
Establish Connection with Device
Retrieve Running Configuration
Search Non-compliant Interfaces
Fixing Non-compliant Configurations
Summary
Chapter 7: Managing Docker and Container Networks
Docker and Containers
Docker & Container Fundmentals
Benefits & Applications
Role of Python in Containerization
Install and Configure Docker
Install Docker
Install Docker Python Module
Create Dockerfile
Build Docker Image
Run Docker Container
Test Docker Container
Using Python to Build Docker Images
Create DockerFile
Install Dependencies
Define Command
Build Docker Image
Run Container
Running Containers
Automate Running of Containers
Install Docker SDK for Python
Import Docker SDK
Connect to Docker Daemon
Define Container Configuration
Create Container
Start the Container
Stop and Remove Containers
Container Network Management
Overview
Managing Container Networks with Docker SDK
Summary
Chapter 8: Orchestrating Container & Workloads
Container Scheduling and Workload Automation
Network Service Disocvery
Understanding etcd
Service Discovery using etcd
Install etcd
Start etcd
Register Services
Discover Services
Automate Service Discovery
Sample Program to Automate Service Discovery
Kubernetes Load Balancers
Exploring HAProxy
Manage Load Balancer Servers using HAProxy
Import Required Libraries
Define API Endpoint URLs
Define Function to Add or Remove Servers
Call Function
Sample Program to Manage Load Balancer Servers
Automate Add/Manage SSL Certificate
Using Cryptography Library to Automate SSL
Step-by-step Illustration of Sample Program
Manage Container Storage
Sample Program
Step-by-step Illustration of Sample Program
Necessity of Container Performance
Why Container Performance?
Container Performance KPIs
Setting Up Container Performance Monitoring
Install the Required Libraries
Import Required Libraries
Connect to Docker API
Get Container List
Pull Performance Metrics
Print Container Metrics
Automated Rolling of Updates
Get Current Deployment Object
Update Deployment Object
Check Status of Deployment Rollout
Clean Up Resources
Summary
Chapter 9: Pod Networking
Pods and Pod Networking
What are Pods?
Pods beyond Containers
Networking in Pods
Setting Up Pod Network
Choose a Pod Network Provider
Install Pod Network Provider
Configure Pod Network
Verify the Pod Network
Exploring Calico
Overview
Characteristics of Calico
Getting Started with Calico
Using Calico to Setup Pod Network
Routing Protocols
Border Gateway Protocol (BGP)
Open Shortest Path First (OSPF)
Intermediate System to Intermediate System (IS-IS)
Routing Information Protocol (RIP)
Exploring Cilium
Key Features of Cilium
Cilium Architecture
Install Cilium
Automation of Network Policies
Overview
Steps for Network Policies Automation
Using Calico to Automate Network Policies
Workload Routing
Need of Workload Routing
Istio
Linkerd
Consul
Summary
Chapter 10: Implementing Service Mesh
Service-to-Service Communication
Remote Procedure Calls (RPCs)
Message-based Communication
Need of Service-to-Service
Rise of Service Mesh
Exploring Istio
Overview
Istio’s Capabilities
Installing Istio
Cluster Traffic
NodePort
LoadBalancer
Ingress
Istio Control Plane
Using Istio to Route Traffic
Metrics, Logs and Traces
Metrics
Logs
Traces
Using Grafana to Collect Metrics
Steps to Collect Metrics
Summary
Preface
With "Mastering Python Network Automation," you can streamline
container orchestration, configuration management, and resilient
networking with Python and its libraries, allowing you to emerge as a
skilled network engineer or a strong DevOps professional.
From the ground up, this guide walks readers through setting up a
network automation lab using the NS3 network simulator and Python
programming. This includes the installation of NS3, as well as python
libraries like nornir, paramiko, netmiko, and PyEZ, as well as the
configuration of ports, hosts, and servers. This book will teach you
the skills to become a proficient automation developer who can test
and fix any bugs in automation scripts. This book examines the
emergence of the service mesh as a solution to the problems
associated with service-to-service communication over time.
This book walks you through automating various container-related
tasks in Python and its libraries, including container orchestration,
service discovery, load balancing, container storage management,
container performance monitoring, and rolling updates. Calico and
Istio are two well-known service mesh tools, and you'll find out how
to set them up and configure them to manage traffic routing,
security, and monitoring.
Additional topics covered in this book include the automation of
network policies, the routing of workloads, and the collection and
monitoring of metrics, logs, and traces. You'll also pick up some tips
and tricks for collecting and visualising Istio metrics with the help of
tools like Grafana.
In this book you will learn how to:
Use of Istio for cluster traffic management, traffic routing,
and service mesh implementation.
Utilizing Cilium and Calico to solve pod networking and
automate network policy and workload routing.
Monitoring and managing Kubernetes clusters with etcd
and HAProxy load balancers and container storage.
Other documents randomly have
different content
See 10a, 16, 17a, 50, 62, 64.
18. Findley, Sarah, “over 50.” She was mother to one of the house-
girls at Bethlehem, in the Santa Cruz Mountains, an old-time woman
and quite illiterate.
See 146.
19. Forbes, William, over 75. He came from Dry River and was one
of my best story-tellers. He had been song-leader and “Tea-meeting
chairman” for his district and was much respected for his intelligence
and sense of order. He came at several different times and sang or
told stories with equal ease and with a freshness and delight which
was contagious, never failing to bring a small gift from his garden
and never arguing over the pay. He had a very long-shaped head
and beaming eyes.
See 2a, 3, 7, 8, 11b, 24, 25b, 46, 70, 85b, 86a, 101, 140,
141, 142.
20. Ford, May, a young girl. She was of the better class, daughter of
the lodging-house keeper at Newmarket, in Westmoreland.
See 44.
See 88.
22. Gentle, Julia, over 70. She came to me twice at Bethlehem in the
Santa Cruz mountains and recited the stories with great rapidity as if
she knew them by heart in a fixed form, among them some English
ballads of second rate interest.
See 73b.
25. Hendricks, Moses, over 60. He was a white man, but lived with
his negro family like one of the race; an excellent story-teller,
dictating some fifteen stories to me at three different visits to his
house.
See 13b, 15, 25a, 26, 29, 35, 48, 69a, 99, 138.
See 5.
28. Hilton, James Anderson, aged 33, one of the Maroon men.
See 149.
29. Iron, Adolphus, about 50. A reputed humorist from Golden Grove
near Claremont, but disappointing in frock coat at the lodging house.
See 20, 37b.
30. Johnson, Emanuel, about 40, from Orange Hill near Brownstown.
32. Macfarlane, Joseph, aged 14. He was a natural clown, long and
loose-jointed. It was in the evening after work at Moneague and he
stood in the middle of the group and acted out the story he was
telling in rapid, unintelligible dialect, and with excellent mimicry of
both speech and gesture. Afterward he recited it to me more slowly,
possibly more in detail.
See 6, 17d, 19, 21a, 34, 45, 52, 54, 55, 57a, 85a (1), 87a, 89,
92b (3), 93, 98, 119, 120, 121, 122, 123, 124, 136, 137.
See 74.
36. Morrison, Vincent, aged 20. He was a Mandeville lad and claimed
to “compose” his stories.
See 94.
37. Parkes, George, over 40. This blind man had lived in different
parts of the island and been over-seas in Africa. He had picked up
stories wherever he went, and he took great pleasure in reciting
them to me. He gave me fifteen at different visits, all very full and
accurate. He was an indifferent singer and made no attempt to act
out the story.
See 1a, 2b, 4, 21b, 22, 23, 30a, 31, 32a, 33, 38b, 65, 87b,
91, 92a, 95.
38. Pottinger, Henry, over 70. We were gathered one evening in his
son’s cottage near Claremont for story-telling when the old man
made his [294]appearance chanting a nonsense line as he came. It
seemed to be a kind of formal prelude to the occasion, but I could
not get the words.
See 103.
39. Pottinger, Richard, over 40. He was son to Henry, with a great
local reputation. A group gathered in his house two evenings after
work and told stories in turn as seemed to be the custom.
40. Ramtalli, (Mrs.) about 30. She was of the better educated class,
from St. Mary’s parish, and wife of the East Indian school-master at
Maggotty.
See 97b.
43. Roden, Mary Jane, over 80. She was bedridden. The cottage had
one room and the floor was partly broken through. Her daughter
was ironing, the little grandchild danced to the songs she crooned.
See 139.
See 63.
See 17b.
49. Smith, James. He belonged to the group who gathered at
Pottinger’s near Claremont, a younger, better educated man, who
claimed to be a “composer.”
50. Spence, Henry, “over 50.” He was song-leader for the workmen
on the Bog estate in Westmoreland and recited some twenty stories
at two different interviews, all briefly and with wit.
See 10b, 12b, 41, 42, 43b, 47b, 92b (2), 118, 128.
See 32c.
See 100.
56. Watson, Ethel, aged 32. She told stories one morning while
tending her sick child at Roseberry Bush, in the Santa Cruz
Mountains.
See 13c.
See 5c, 66, 67, 68, 78a, 80, 82a, 83, 87a (note), 93, 96.
60. Williams, Alfred, his friend. He was the Maroon song-leader and,
with White, led the games and sports. A good singer, but an
indifferent story-teller.
See 71b.
64. Wright, Charles, aged 44. He was one of the group at Harmony
Hall, but not a Maroon.
See 9.
See 53.
Colophon
Availability
This eBook is for the use of anyone anywhere at no cost and with
almost no restrictions whatsoever. You may copy it, give it away or
re-use it under the terms of the Project Gutenberg License included
with this eBook or online at www.gutenberg.org ↗️.
The MP3 and MusicXML versions of the music in this book were
produced by Jude Eylander and other volunteers at PGDP.
Metadata
Encoding
To help navigation of this text, links have been added between the
stories and the corresponding notes at the end of the work.
The words in the musical scores have been transcribed, and added
below the scores, to enable search and reading them through text-to-
speech processors.
Revision History
2023-11-02 Started.
Corrections
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.
• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.