nerdexam
Cisco

200-901 · Question #583

Refer to the exhibit. A developer is creating a YANG file to design data with Python. Which code must be used for the tree of the YANG file?

The correct answer is A. pyang -f tree future-industries-tech.yang. To visualize the hierarchical structure of a YANG file as a tree, the pyang tool is used with the -f tree command-line option.

Software Development and Design

Question

Refer to the exhibit. A developer is creating a YANG file to design data with Python. Which code must be used for the tree of the YANG file?

Exhibit

200-901 question #583 exhibit

Options

  • Apyang -f tree future-industries-tech.yang
  • Bpyang -i tree future-industries-tech.yang
  • Cpyang -f leaf future-industries-tech.yang
  • Dpyang tree future-industries-tech.yang

How the community answered

(20 responses)
  • A
    90% (18)
  • B
    5% (1)
  • D
    5% (1)

Why each option

To visualize the hierarchical structure of a YANG file as a tree, the `pyang` tool is used with the `-f tree` command-line option.

Apyang -f tree future-industries-tech.yangCorrect

The `pyang` tool is a validator and converter for YANG data models, and the `-f` or `--format` option is used to specify the output format. The `tree` format specifically renders the YANG data model in a human-readable, hierarchical tree structure.

Bpyang -i tree future-industries-tech.yang

The `-i` option for `pyang` is used to specify import paths for YANG modules, not for defining the output format.

Cpyang -f leaf future-industries-tech.yang

While `-f` is the correct option for format, `leaf` is a YANG data type and not a valid output format for `pyang` to display the model as a tree.

Dpyang tree future-industries-tech.yang

The `pyang` command requires the `-f` flag to specify `tree` as an output format; otherwise, `tree` would be interpreted as a module name to be processed.

Concept tested: YANG model visualization (pyang tree)

Source: https://datatracker.ietf.org/doc/html/rfc7950

Topics

#YANG#pyang#Data Modeling#CLI Tools

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice