Chapter 2 Automate APIs and protocols Flashcards
Automate APIs and protocols
What is YANG?
YANG is a data modelling language used to send information over NETCONF or RESTCONF protocols. It can be converted to XML or JSON.
What are the building blocks of YANG models?
- Containers → group related elements together
- Lists → ordered or unordered collection of entries (each entry can contain multiple elements)
- Leafs → represent a single piece of data (integer, string…)
- Leaf-lists → similar to a leaf but contain multiple simple values (integer, strings…)
How do you identify a JSON instance based on a YANG model?
Use the following rules:
- Container: A key-value pair in a dictionary, where the value is another dictionary.
- List: A key-value pair in a dictionary, where the value is a list of dictionaries.
- Leaf: A key-value pair in a dictionary, where the value is a scalar value.
- Leaf-list: A key-value pair in a dictionary, where the value is a list of scalar values.
How do you identify an XML instance based on a YANG model?
Use the following rules:
- Container: Represents a top-level XML element.
- List: Repeated XML elements under the container.
- Leaf: Individual tags with values inside them.
- Leaf-list: Multiple equal tags with different values.
What does the YANG module tree indicate?
The YANG module tree shows the hierarchical structure of a YANG module, indicating read/write capabilities and the relationships between elements.
What are the symbols used in a YANG module tree?
+— indicates a child element,
rw means the element can be read and written,
ro means it can only be read,
* marks a list or leaf list,
? indicates an optional element, and
[key] represents the key of a list.
What are the three main types of YANG models?
The three main types of YANG models are OpenConfig, IETF, and Native models.
What is OpenConfig?
OpenConfig modules are vendor-neutral and can be implemented in infrastructures with multiple vendor devices.
What is IETF?
IETF models are created and maintained by the IETF, making them widely accepted standards.
What are Native models?
Native models are vendor-specific and offer the most control over vendor-specific configurations.
What is NETCONF?
NETCONF is an IETF standard network management protocol designed for network device configuration and state retrieval.
What are the initial messages in a NETCONF session?
The initial messages are rpc (request) and rpc-reply (response).
What functions does NETCONF support?
NETCONF supports functions like get, get-config, and edit-config.
What is RESTCONF?
RESTCONF operates with HTTP CRUD operations and allows specifying methods and resources via URLs.