CCNA 200-901: The Network Engineer’s Guide to YAML Data Types | Knowledgestreams

 If you are gearing up for the CCNA Automation (200-901) exam, you already know that the days of managing networks purely through the CLI are fading fast. Modern network programmability relies heavily on structured data, and at the heart of tools like Ansible and Python-driven automation is YAML.


CCNA 200-901 DevNet YAML Data Types Automation
Master YAML


YAML (YAML Ain't Markup Language) is incredibly human-readable, but if you don't understand its core data types, a single misplaced space can break your entire automation script.

Welcome to another deep dive by Knowledgestreams. Today, we are stripping away the complexity and breaking down the basic YAML data types you absolutely need to know to crush your 200-901 exam and build rock-solid network automation.


The Big Three: Basic YAML Data Types

YAML was designed to be cross-compatible with most modern programming languages (like Python, JavaScript, Ruby, and PHP). It accomplishes this by relying on three foundational data structures:

  1. Scalars (Strings, numbers, and booleans)

  2. Sequences (Lists or arrays)

  3. Mappings (Hashes, dictionaries, or key-value pairs)

Let’s look at exactly how they work in a networking context.


1. Scalars: The Building Blocks

Think of scalars as the actual "data" on your page. They are the individual strings, IP addresses, or integers you are trying to configure. YAML gives you five different styles for writing scalars, depending on how complex your text is.

  • Plain: No quotes or indicators. Used for simple text or numbers.

  • Single-quoted ('): Wraps the value. It prevents YAML from treating special characters as syntax. (Note: No escaping occurs here, except that duplicate quotes '' are read as a single quote).

  • Double-quoted ("): Used when you need to use escape sequences like \u**** for Unicode characters or \x** for ASCII.

  • Literal block (|): Perfect for multi-line configurations (like banners or certificates). It preserves all your exact line breaks.

  • Folded block (>): Similar to the literal style, but it automatically folds consecutive non-empty lines into a single line separated by spaces. It only preserves forced blank lines.

Cisco Official link

XML based prompt Engineering

XML DOM explained

XML Basics


YAML Scalar Examples:


CCNA 200-901 DevNet YAML Data Types Automation

YAML Scalar Example



2. Sequences: Making Lists

In network automation, you rarely deal with just one of anything. You have multiple VLANs, multiple routing peers, and multiple interfaces. In YAML, we handle these using Sequences.

Sequences are simply lists. Each item in the list is placed on its own line and starts with an opening dash (-) followed by a space.

Basic Sequence Example


CCNA 200-901 DevNet YAML Data Types Automation

Sequence Example

Nested Sequences

You can create lists within lists (sub-items) by indenting the child items. In YAML, indentation is strictly enforced using spaces (never tabs!).

CCNA 200-901 DevNet YAML Data Types Automation
Nested Sequences Example

You can go as many levels deep as your automation logic requires, simply by maintaining proper space indentation.


3. Mappings: Key-Value Pairs

Mappings are exactly what they sound like: they map a specific key to a specific value. If you are familiar with Python dictionaries (a massive part of the CCNA 200-901 curriculum), mappings are the exact YAML equivalent.

They are created using a colon and a space (: ).

Basic Mapping Example

CCNA 200-901 DevNet YAML Data Types Automation

Mapping Example

Combining Mappings and Sequences (Real-World Usage)

In the real world of DevNet and CCNA automation, you will almost always combine mappings and sequences. For example, if you are writing a playbook to configure a list of interfaces, you map a key (like interfaces) to a sequence (your list of ports).


CCNA 200-901 DevNet YAML Data Types Automation
Combining Mappings and Sequences


Wrapping Up

Mastering these three basic structures—Scalars, Sequences, and Mappings—is your first major step toward passing the CCNA Automation (200-901) exam. Once you know how to format your data, pushing configurations to Cisco devices via Python or Ansible becomes incredibly straightforward.

Ready to take your network programmability skills to the next level? Stay tuned to Knowledgestreams for more hands-on DevNet tutorials, labs, and exam prep guides!

Cisco Official link

XML based prompt Engineering

XML DOM explained

XML Basics


Featured Post

Day 41 — BGP Confederations: Sub-AS Design, External View and Migration

1. Opening Confederations are another way to scale BGP inside a large administrative domain. They divide the domain into member autonomous systems while presenting a single confederation identifier to external peers. They are powerful, but their operational model is more complex than simply 'using private ASNs inside.' The engineering goal is not to memorize another BGP command. It is to understand what information each speaker is allowed to propagate, what path information can be hidden, and what failure domain is created by the chosen control-plane architecture . 2. Concept and standards behavior RFC 5065 defines AS_CONFED_SEQUENCE and AS_CONFED_SET and how member-AS relationships are represented. Confederation external sessions have eBGP-like properties inside the confederation, while the confederation is presented externally as one AS. Modern guidance must also account for the fact that RFC 9774 prohibits new origination of AS_SET/AS_CONFED_SET in ordinary aggregation c...