Skip to content

Latest commit

 

History

History
110 lines (84 loc) · 6.95 KB

File metadata and controls

110 lines (84 loc) · 6.95 KB

Learning Programming Golang

Target Audience: Network engineers, DevOps engineers, and anyone interested in modern network automation using Go.

Learning Objectives:

By the end of this tutorial, you will be able to:

  • Understand Go fundamentals relevant to network automation.
  • Automate configuration and state retrieval using NETCONF with Go.
  • Leverage gNMI for configuration, operational state, and streaming telemetry with Go.
  • Work with JSON and YAML data formats in Go for network configurations.
  • Build simple Go applications for network automation tasks.

Prerequisites:

  • Basic Linux Command Line Knowledge: Familiarity with cd, ls, mkdir, docker, ssh.
  • Fundamental Networking Concepts: Understanding of IP addressing, routing, interfaces, VLANs.
  • Basic programming concepts variables, loops, functions
  • Docker Installed: Containerlab relies on Docker. Ensure it's installed and running on your Linux machine (or WSL2 on Windows, or OrbStack on macOS with a Linux VM).
  • Containerlab Installed: Follow the official Containerlab installation guide: https://containerlab.dev/install/
  • Arista cEOS-lab Image: You'll need to download the cEOS-lab image from the Arista support portal (requires an Arista account, free lab versions are available). Import it into Docker: docker import cEOS-lab-<version>.tar.xz ceos:<version> (e.g., ceos:4.30.6M).
  • Go Installed: Download and install Go from https://golang.org/doc/install.

Module 1: GoLang Fundamentals

Day Description
1 Getting Started with GoLang
2 Variables, Data Types, and Operators
3 Control Flow (If/Else, For Loops, Switch)
4 Functions, Packages and Error Handling
5 Slices, Maps, and Structs

Module 2: Containerlab Setup & Basic Router Interaction (Days 6-10)

Day Description
6 Introduction to Containerlab
7 Initial cEOS Configuration with Containerlab
8 GoLang Basic File I/O for Config Files
9 Structuring Go Projects and Modules
10 Basic Interaction with cEOS (Manual SSH/eAPI prep)

Extras (SSH with Nokia SRL)

Extra Description
M2.E 1 SSH/CLI Automation with Go
M2.E 2 Containerlab Multi-Node Topology (SRL)
M2.E 3 Inventory Management in Go for Containerlab

Module 3: GoLang and Arista eAPI (Days 11-15)

Day Description
11 Introduction to Arista eAPI and GoeAPI Library
12 Parsing eAPI Responses with Go Structs
13 Sending Configuration Commands via eAPI
14 Advanced eAPI Operations: Multiple Commands & Error Handling
15 Templating Configurations with Go's text/template

Extras (with Nokia SRL and NETCONF) (TEST IT)

Extra Description
M3.E 01 NETCONF with Go - Basic Get Operations
M3.E 02 NETCONF with Go - Edit Operations

Module 4: Advanced GoLang for Network Automation (Days 16-20)

Day Description
16 Concurrency with Goroutines and Channels
17 Building a Simple CLI Tool with flag
18 Working with JSON and YAML Configuration Files (External Data
19 Building a Network Discovery and Reporting Tool
20 Putting It All Together: Automated Lab Deployment & Configuration

Module 5: GoLang and gNMI for Streaming Telemetry & Configuration (Days 21-24)

Day Description
21 Introduction to gNMI and Basic Connection
22 gNMI Get RPC for Operational State
23 gNMI Set RPC for Configuration
24 gNMI Subscribe for Streaming Telemetry

For further informations on using Golang with gNMI look at the documentation and especially in the example of CAPABILITIES, GET, SET and SUBSCRIBE.

Project

Project Description
Final 01 Building a Generic Network Client in Go
Final 02 Building a Simple Automation Tool & Next Steps

Create a CLI

If you are interested in creating a CLI with Cobra go to Creating a CLI

Create a Terraform provider (coming soon!)

If you are interested in creating a Terraform Provider go to Creating a Terraform-Provider
For further informations go to https://developer.hashicorp.com/terraform/tutorials/providers-plugin-framework

Create a Kubernetes Operator (coming soon!)

If you are interested in creating a Kubernetes Operator go to Creating a Kubernetes Operator
For further informations go to https://book.kubebuilder.io/

Final ToDo

Post about your journey, what you learned on different platforms like LinkedIn, Twitter or any other of your favourite platforms. Follow up on your journey and share it with others! Use the Hashtags #NetAutoBootcamp #NetworkAutomation You can also tag us on LinkedIn with @netauto-group-rheinmain