DevNet Associate (DEVASC) v1.0Infrastructure and AutomationMedium
A network architect is designing a system for network programmability that needs to support both configuration changes and operational data retrieval. The system requires a human-readable, text-based data format that is easy to parse and generate, often used with RESTful APIs. Which data format would be the most suitable choice?
- AProtocol Buffers
- BJSON
- CYAML
- DXML
Show answer & explanationAnswer & explanation
Correct answer: B. JSON
JSON (JavaScript Object Notation) is a lightweight, human-readable, and easy-to-parse text-based data interchange format. It is widely adopted in web services and RESTful APIs due to its simplicity and broad language support, making it ideal for network programmability where human readability and ease of parsing are key.
Why the other options are wrong
- A. Protocol Buffers are a binary format, highly efficient but not human-readable, used primarily with gRPC.
- C. YAML is primarily used for configuration files and manifests, not typically for data interchange in RESTful APIs.
- D. XML is structured but more verbose and often less human-readable than JSON, used by NETCONF.
JSON
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is human-readable and easy for machines to parse and generate, making it a popular choice for web APIs.
- Human-readable, text-based.
- Easy to parse and generate.
- Widely used with RESTful APIs.
- Supports data structures (objects, arrays).
Memory trick: API data formats vary by readability, verbosity, and efficiency.