Automation is a trending topic in the realms of IT infrastructure, for good reason: used correctly, it can represent a transformational enhancement to your infrastructure maintenance and deployment workflow! Python is one of the leading languages in the world for use in infrastructure automation, because of its lightweight nature, ease of use, and extensive array of available libraries. This course will explore many key constructs in developing with Python and examine their applications in the context of infrastructure automation. The course will feature live instructor engagement and demonstrations, as well as a 17-lab asynchronous lab workbook for students to use to practice the skills that they have gained.
Course Objectives
- Install and configure a Python development environment, with accompanying IDE/code editor, for use in the development of automation workflows
- Identify and apply key constructs of Python development to the creation of scripts intended for automation of infrastructure, including, but not limited to, built-in data types, built-in methods, variables, comments, filesystem interaction, custom functions, and custom classes/object types, and Python libraries.
- Identify and apply key constructs of general software development to the creation of scripts intended for automation of infrastructure, including, but not limited to, regular expressions, data encoding with XML and JSON, and API models.
- Identify and apply key constructs of application programming interface (API)-based programmatic interactions to the development of scripts intended for automation of infrastructure, including, but not limited to, HTTP methods, RESTCONF/NETCONF, YANG, cURL, Postman, and the Python requests library.
Module 1: Introduction to Python
- Module Introduction:
- Overview of Python
- Basic Characteristics of Python
- Installing Python
- Running Python
- Code Editors/IDEs
- Python Virtual Environments
- Installing Packages/Libraries
- Lesson 1:
- Strings, including manipulation
- Printing
- Variables
- Comments
- Operators
- Built in methods
- Input from users
- Describe Boolean
- Lesson 2:
- Control flow/conditional logic (if-elif-else statements)
- Redundant scripts
- Functions
- Classes
- Lesson 3:
- Lists
- Reading from Files
- Writing to Files
- Reading and Writing to Spreadsheets (CSV)
- Reading and Writing to Text Files
- Substituting strings and integers
- While loops
- For loops and comprehensions
- Slicing
- Updating and edit a list
- Error checking
- Using the Netmiko Library
- Lesson 4:
- Dictionaries Overview
- Dictionary Methods
- Nested Lists within Dictionaries
- Regular expressions (match, search, findall, sub)
Module 2: Introduction to Web Services Protocols
- Module Introduction:
- What makes APIs useful and popular?
- Use of APIs
- Benefits of API Usage
- Lesson 1:
- Common Web Services Protocols and Transport Methods
- Management Information Tree (MIT) Object View
- Object Naming Conventions
- Plain Text vs Encoded Data
- Lesson 2:
- Basic XML concepts
- Format of an XML document
- Basic JSON concepts
- Format of an XML document
- Navigating within JSON and XML Documents
- Lesson 3:
- Generic construction of a YANG Model
- Generic construction of an XML Schema
- Usage of XML Schemas and YANG Models
- Lesson 4:
- Interacting with device APIs using cURL
- Interacting with device APIs using Postman
- Interacting with device APIs using Python (requests)
- Lesson 5:
- Parsing JSON Documents in Python with the json library
- Parsing XML Documents in Python with the ElementTree library
The primary audience for this course is as follows:
- Network Administrators
- Python devs
- Administrators interested in Automation
- Individuals interested in devops, specifically for networking