200-901 exam dumps

200-901 practice question 167 of 204

Cisco DevNet Associate. Associate level, Cisco. Free question with the correct answer and a full explanation.

200-901 Question 167

Single answer

You are reviewing a YANG model for a network device and encounter the following snippet:

module example-interface {
    namespace "http://example.com/interfaces";
    prefix intf;

    container interfaces {
        list interface {
            key "name";
            leaf name {
                type string;
            }
            leaf enabled {
                type boolean;
            }
        }
    }
}

What does the key statement in the interface list represent?

  1. A

    The primary attribute used to uniquely identify each entry in the list

  2. B

    The namespace used to reference the module's elements

  3. C

    The parent container that groups all interfaces together

  4. D

    A mandatory leaf that specifies the operational status of the interface

Show answer and explanation

Correct answer: A

Explanation

In YANG models, the key statement within a list specifies the unique identifier for each list entry. In this case, the name leaf is used as the key, meaning each interface in the interface list must have a unique name. This ensures that the list can be properly indexed and managed.

  • A. Correct.

    Correct. The key statement specifies the primary attribute (name) that uniquely identifies each entry in the interface list.

  • B. Incorrect.

    Incorrect. The namespace is defined by the namespace statement at the module level, not the key statement.

  • C. Incorrect.

    Incorrect. The parent container is defined as interfaces, but this is unrelated to the key statement.

  • D. Incorrect.

    Incorrect. The enabled leaf represents the operational status of the interface, but it is not related to the key statement.

Timed practice exam

Take a 200-901 practice test under exam conditions

75 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam